Load Kit reference

Every robotelos-load flag with its default, the environment variables, the target file keys, the fields of the run record and of a query result, and the constants.

This page lists exact facts. For how to use them, see the other pages of the Load Kit. The flags are the output of robotelos-load -h. That command exits with 2.

Flags

Scenario and load

FlagDefaultMeaning
-scenariofanoutfanout, many, idle or reconnect.
-followers10Connections that follow a conversation. For idle, the idle connections. For many, per conversation.
-conversations10Conversations at once (many).
-hold5sHow long the connections idle before the probe (idle).
-before20Events every follower has before the storm (reconnect).
-during20Events sent while all followers are gone (reconnect).
-events200Events in the measured phase.
-warmup20Events before it, sent and checked but not measured.
-interval10msTime between two sends.
-drain5sHow long to wait for the last event at every follower.
-seed1Seed recorded in the result.
-transportpipepipe (in process), ws, grpc or sse.

Target and server

FlagDefaultMeaning
-urlemptyServer to dial: a ws or sse URL, or a gRPC host:port. Empty starts a server in this process. The token is read from ROBOTELOS_LOAD_TOKEN.
-targetemptyName of a target of the target file. Flags override what it says.
-targetsROBOTELOS_STRESS_TARGETS, else ~/.robotelos/stress-targets.yamlThe target file. Needs -target.
-environmentemptyThe environment the target is expected to be, for the record and the baseline.
-metrics-urlemptyPrometheus endpoint of the server at -url. The change over the run goes into the result.
-pprof-urlemptyDiagnostics listener of the server at -url. Its profiles go to -pprof-dir.
-pprof-diremptyDirectory for the profiles of the server at -pprof-url.
-pprof-seconds10Length of the server CPU profile. Set it to about the measured phase. At least 1.
-grafana-urlemptyGrafana to annotate with the start and end of the run. Off when empty. The token is read from ROBOTELOS_GRAFANA_TOKEN.

Output and objectives

FlagDefaultMeaning
-outemptyDirectory for run records and, for a suite, its results. The exit code is then that of the record.
-benchemptyAppend the result as a Go benchmark line to this file, for benchstat.
-slo-p990Fail the run when p99 latency exceeds this. 0 means none.
-cpuprofileemptyWrite a CPU profile of the run to this file.
-mutexprofileemptyWrite a mutex contention profile of the run to this file.
-memprofileemptyWrite a heap profile at the end of the run to this file.

Suites, judging and baselines

FlagDefaultMeaning
-suiteemptybaseline or smoke. Runs a fixed list of cases and writes its results to -out.
-runs6Runs of each case of a suite. Only with -suite. Six is the least benchstat can give an interval for.
-judgefalseJudge the run, or each case, by the queries of -stress-dir against its baseline. Needs -url, -out, a Grafana and an environment.
-stress-dirstressDirectory with queries.json and baselines/<env>/<suite>/<case>.json. Only with -judge or -accept-baseline.
-accept-baselinefalseAccept the baselines of the stored runs below the directories after the flags. Takes no other flag but -stress-dir. Asks no server.

Refusals, all exit 2:

  • -runs without -suite.
  • -out with an empty value.
  • -stress-dir without -judge or -accept-baseline.
  • -suite without -out, with -runs below 1, or with a flag the suite fixes: -scenario, -followers, -conversations, -hold, -before, -during, -events, -warmup, -interval, -bench, -slo-p99, -cpuprofile, -mutexprofile, -memprofile, -pprof-url, -pprof-dir, -pprof-seconds.
  • -metrics-url or -pprof-url without -url. -pprof-url without -pprof-dir.
  • An unknown scenario, suite or transport, or -url with -transport pipe.
  • A token in plain text to a host that is not loopback.
  • A token of fewer than 8 bytes with -out.
  • -judge without -url, -out, a Grafana or an environment, or without a readable queries.json.

Environment variables

VariableUsed for
ROBOTELOS_LOAD_TOKENThe bearer token of the server at -url, when the target names no other source.
ROBOTELOS_GRAFANA_TOKENThe service account token of the Grafana at -grafana-url, when the target names no other source. The local judged stack needs none.
ROBOTELOS_STRESS_TARGETSThe path of the target file.

The script scripts/judged-stack.ps1 also reads ROBOTELOS_POSTGRES_PORT, ROBOTELOS_GRAFANA_PORT, ROBOTELOS_OTLP_GRPC_PORT, ROBOTELOS_OTLP_HTTP_PORT, ROBOTELOS_JUDGED_HTTP_PORT and ROBOTELOS_JUDGED_GRPC_PORT. Its parameters are -Stop, -Project (default robotelos-judged), -Dir (default <temp>/robotelos-judged) and -StoreDelay.

Target file keys

The file has one top-level key, targets, a map from a target name to these keys. An unknown key is refused.

KeyMeaning
environmentA name usable as one path segment (letters, digits, ., _, -; at most 64 characters; no device names).
urlAddress without a user, query or fragment.
token-envThe name of a variable (letters, digits, _).
token-fileThe path of a file with the token. ~/ is your home directory.
disposabletrue for a throwaway server. Refused for dev, stg and prod.
grafana.urlAddress of the Grafana, same rule as url.
grafana.token-env, grafana.token-fileToken source of the Grafana.

For each token, give token-env or token-file, not both.

Files

PathContent
<out>/<run_id>/run.jsonThe run record.
<out>/<run_id>/report.mdThe report of the record.
<out>/<run_id>/all.txtBenchmark lines of the runs, and one BenchmarkStress/... line per measured metric.
<out>/<run_id>/runs/<n>.jsonThe result of run n.
<out>/<run_id>/runs/repeat<k>.<n>.jsonA run made to confirm a slow timing.
<out>/report.md, all.txt, environment.txt, runs/<case>.<n>.jsonThe files of a suite.
<stress-dir>/queries.jsonThe fixed queries and the export interval.
<stress-dir>/baselines/<env>/<suite>/<case>.jsonA baseline.

The run record

run.json has the schema robotelos.stressrun/1. Durations are in nanoseconds.

FieldMeaning
schema, run_idThe format and the run’s name.
suite, case, scenarioThe suite (the scenario for a single run), the case of a suite, and the scenario.
windowOf a judged run: start, end, evaluate_at, range_ns.
category, planeload and data for robotelos-load.
started_at, duration_nsWhen it started and how long it took.
gitcommit and dirty.
buildgo_version, race, tags.
environmentThe generator machine: name, os, cpu, gomaxprocs, memory_bytes, postgres, pool_max_conns, transport, generator_shares_process.
targetname, class (started for a server the tool started), stated_environment, expected_environment, effects_mode, control and conversation (addresses without a user), build, shared.
runnerid, kind (robotelos-load), location.
cleanupdone, leftovers, data_left_on_disposable.
seed, paramsThe seed and the parameters of the scenario.
loadscenario, params, warmup, runs, transport. A baseline is of one load.
objectivesapplied: the objectives of -slo-p99, each with metric, op, quantile and max_ns.
metricsOne entry for the latency of the run: name, op, unit, count, p50 to p999, max, rate_per_s, outcomes (lost, duplicates, reordered, errors) and failures.
queriesThe query results of a judged run. See below.
repetitionsThe further runs of a case made to confirm a slow timing. Each has a window, metrics, generator, cancelled and error.
generatorusable and max_schedule_lag_ns.
cancelled, errorThe run was stopped before its end, and why it could not be carried out.
verdict, reasons, warningsThe verdict, why it is not PASS, and what does not change it.
artifactsThe files of the run directory with their kind, path and SHA-256.

The fields caps, series, faults, oracle and fuzz exist in the schema for other kinds of runs and are empty for robotelos-load.

A query result

Each entry of queries is one query for one label set.

FieldMeaning
queryThe name in queries.json.
hashThe hash of the query’s kind and expression. A baseline of another hash is not compared.
seriesThe label set, empty for a series without labels.
statusPASS, FAIL, NOT_APPLICABLE or NOT_JUDGED.
valueThe value of the run, or null for no data.
baselinemedian, min, max and n of the baseline.
limitThe largest value the baseline allowed. Set whenever the value was compared.
error, unreachableWhy the backend gave no answer.
reasonWhat there is to tell a person: a regression, why it was not judged, or an improvement.
confirmationOn a timing that was above its limit: values of the repetitions and the median.
linksOn a finding: explore and traces.

A baseline file has environment, load and, per query name, hash, commit and series, each series with median, min, max and n.

Constants

WhatValue
Exit codes0 PASS, 1 FAIL, 2 bad arguments, 3 INCOMPLETE, 4 TECHNICAL_ERROR, 5 cancelled
Usable generatorAt most 5 ms behind its schedule, and nothing lost, repeated, reordered or failed
Usable runs of a suite caseAt least 3
Runs of a baselineAt least 6, each a separate invocation
Minimum window of a judged run60 s
Export interval in queries.json15 s
Time of a judged caseAt least 105 s: 30 s quiet, 60 s window, 15 s quiet
Confirmations of a slow timing2 more runs of the whole case
Timing limitbaseline max x (1 + tolerance). The tolerance is 0.25 for the five queries in the repository.
Count limitbaseline max + (baseline max - baseline min)
Shortest token that can be redacted8 bytes
Environments that cannot be disposabledev, stg, prod
Smoke suitefanout-followers-2, many-conversations-2, idle-connections-3, reconnect-followers-2
Baseline suitefanout-followers-1, -10, -100, -1000; many-conversations-10, -100; idle-connections-100, -1000; reconnect-followers-100, -1000

Next steps