Repository navigation
Releases
Releases · RIRUa/jotaro
v0.1.3
Changed
record.ReadRawnow returns an error that wraps the newrecord.ErrNotRawwhen its input is not raw data at all: an empty input, or a line without atypefield such as an aggregated JSON result. Such input used to read as a run without records, so this may affect code that relied on reading an empty input; a stream that holds only themetaline still reads as a run without requests. As a resultjotaro export,-rawofjotaro report/merge/check/compareand the MCP tools withraw: truefail with a message that asks for the output ofPlan.Raw, instead of printing an empty result orno data.Plan.Rawnow streams: each record is written to it as it arrives (record.RawWriter) instead of being kept in memory and written at the end, so memory stays constant withPlan.Rawtoo. TheReportthatRunreturns is aggregated incrementally in that case as well, so its percentiles are within 1% relative error (they were exact before); re-aggregate the raw data withjotaro report -raworreport.FromRawfor exact ones. Lines are now in arrival order and the stream ends with a secondmetaline holding the finaldroppedandelapsed_ns;ReadRaw(including older versions) reads it unchanged, andRawVersionstays1.
Added
examples/mix: a small load test that showsPlan.Scenarios,UserStageswithRepeatUserStagesandStartUsers,AbortOn,Progress,MetricsAddr,ExpectStatusIn/ExpectJSON/Response.JSONand thresholds per scenario, laid out the way the README recommends for a project. There are also godoc Examples forRepeatUserStages,Plan.UserStages,Plan.Scenarios,Plan.AbortOn,Response.JSONandResponse.ExpectJSON, and the examples README walks through running a test, checking it withjotaro checkand reading it withjotaro report. Thecheckoutandmarketplaceexamples now print the report whenRunreturns one together with an error.report.Aggregator.Snapshot(elapsed): aReportwithout the per-secondSeries, for polling a run in progress. It takes about the same time however long the run is, whileReportwalks every second of it.AbortOnandMetricsAddruse it, so they hold the aggregator's lock only briefly.jotaro mcp: the guide coversPlan.Scenarios/Weighted, theExpect*checks andResponse.JSON, its skeleton savesresults/result.jsonand handlesErrAborted, and it has a section on where the files of a load test go. The thresholds document recommendsdropped<1next tocorrected_*, and thewrite_scenarioprompt ends with how to run the scenario and read the result.jotaro mcp: thejotaro://resultresource explains how to save a result and how to read it (structure, what each number and error kind means, what to check first).jotaro mcp: thesummarize_resulttool returns the key numbers of a saved result file (throughput, error rate, latency per step, dropped arrivals, the worst second) and warnings such as a saturated load generator, without the histograms and the per-second series.jotaro mcp: thecheck_resulttool judges a saved result file (JSON, or raw data withraw: true) against thresholds, likejotaro check, and returns pass or fail per threshold with the measured value.- The text report now prints a
warning:line underdropped:when arrivals were dropped by thePlan.MaxUserscap ("I'll tell you exactly what just happened: N arrivals were dropped..."), so drops are hard to miss. Nothing changes when no arrival was dropped. Plan.MetricsAddr: serve the live state of a run at/metricsin the Prometheus text format (requests, responses by status class, errors, throughput, latency quantiles), so Grafana and similar tools can chart it during the run. It is written by hand, adds no dependency, and stops whenRunreturns.jotaro export -format vegeta|csv [-o file] <raw.jsonl | ->,report.WriteVegetaandReport.WriteSeriesCSV: convert raw data (the output ofPlan.Raw) to vegeta's JSON result lines, whichvegeta report -type=jsonandvegeta plotcan read, or to a CSV of per-second request counts, errors, connections, concurrency and latency percentiles. The vegeta format cannot carry scenario or step details, so the attack name is<scenario>/<step>.- Scenario-level latency in thresholds:
iteration_p95,iteration_active_p99and the otheriteration_[active_]<stat>metrics judge the time of a whole scenario iteration (with or without Think time), for the whole run or per scenario with{scenario=...}. The distribution was already in the report asIterationStats.Total/Active; this makes it usable injotaro checkand inAbortOnrules. Plan.ScenariosandWeighted: run a weighted mix of scenarios in one plan (for example 70% browse, 30% checkout). Each iteration (closed model) or arrival (open model) picks one scenario at random in proportion to its weight. It is mutually exclusive withPlan.Scenario, and the scenarios must have distinct names. Reports and thresholds already separate results by scenario name.jotaro mcp's lint accepts the new field.- Richer response checks:
Response.ExpectStatusIn,ExpectHeader,ExpectBodyContainsandExpectJSON(path, want), all reported asexpect_mismatchlikeExpectStatus, andResponse.JSON(path)to pull one value out of a JSON body with a dot path such asdata.items.0.id, without a struct.ExpectErrorgains aDetailfield for non-status mismatches (Wantis 0 for them). No new dependencies. jotaro compare base.json new.jsonandreport.Compare: per-step and overall diffs (rps, p50/p95/p99, error rate) between two results, with-max-p95-regression <percent>to exit with code 1 on a regression.Plan.AbortOnandAbortRule: stop a run early when a condition holds, for example{When: "http_5xx_rate>50%", For: 5 * time.Second}, so a broken server is not hit for the wholeDuration.Whenuses the threshold syntax (report.ParseThreshold) but names the state to stop at. It is evaluated every second against the whole run so far (not a sliding window), andForis how long it must hold without a break. On abort no new iterations start and running ones getGracecounted from the abort.Runreturns the partial report (and writesPlan.Raw) together with an error wrapping the newErrAborted, and writes anaborted: ...line toPlan.Progressif it is set.Plan.Progress: anio.Writerthat receives one line per second while a run is in progress, such as12s/60s rps=480 p95=38ms err=0.2%(elapsed/duration, throughput of the last second, and p95 and error rate over the run so far). It works with and withoutPlan.Raw, adds no recording cost, and writes nothing afterRunreturns.RepeatUserStages(n, stages...): repeats a sequence ofUserStagen times, so a load shape that goes up and down several times (waves, spikes) does not have to be written out by hand. Join it with other stages usingappend.Plan.StartUsers: how many users are already running when the first stage ofPlan.UserStagesbegins (default 0), so a run can start at full load instead of ramping up from 0. It can only be set together withUserStages.Plan.UserStagesandUserStage: change the number of concurrent users over time in the closed model (for example ramp up to 100 users, hold, ramp down), like k6's ramping-vus. It is mutually exclusive withPlan.UsersandPlan.Arrival. Users keep theirUser.IDand iteration count across stops and restarts; a user stopped by a lower target finishes its running iteration first.Series.Concurrencyshows the resulting load shape.jotaro mcp's lint and authoring guide know the new field.
Fixed
- A descending
Ramp(for exampleRamp(11, 0, time.Second, 10*time.Second)) could compute NaN for its last arrival because of rounding. That arrival then started immediately with the start of the ramp as its scheduled time, which overstated the corrected latency (its max became as long as the ramp), and insideStagesone arrival too many was started. The last arrival now lands at the end of the ramp. - The documentation said that
error_rateincludes failedExpect*checks. It never did:error_rateis the share of requests that ended in a transport-level error (timeout, connection refused, DNS failure and so on). A failedExpect*check fails the step withexpect_mismatchand reachesiteration_fail_ratewhen the scenario returns that error. The README,docs/result.md, the godoc ofAbortRuleandThresholdand the MCP documents now say so, and say how to fail a run on wrong responses. The behavior is unchanged. - The HTML report shows the load model as
closedoropen. It showedclosed (Users)/open (Rate), which was wrong forUserStages,RampandStages. README.md,docs/result.mdandDESIGN.md(and their Japanese versions) described features as missing or planned that exist (stopping a run early, scenario-level latency, vegeta export,/metrics), and other details that no longer matched the code. They are brought in line with the implementation, and the README gains a section on how to lay out a load test project.jotaro mcp:check_scenariono longer reports an error for aPlanwhoseUsers,UserStagesorArrivalis assigned after the literal (for exampleplan.Users = 20), asexamples/checkoutdoes.jotaro mcp: withoutdir,check_scenariotype-checks against the jotaro version of the running binary (the latest one only for a development build), so code that follows the embedded guide no longer fails withunknown fieldwhen the latest release is older than the binary.jotaro mcp: the server reports its real version to the client instead ofv0.1.0, andvalidate_thresholderrors no longer start withjotaro:.Aggregator.Reportreturned the aggregator's liveStatusandErrorsmaps, so a report taken while r...
v0.1.2
Changed
RunwithoutPlan.Rawnow aggregates incrementally: records are folded into histograms as they arrive instead of being kept, so memory no longer grows with the number of requests (5 million requests: about 1165 MB → 9 MB of collector heap in one measurement). As a result,P50–P99in that report are approximations within 1% relative error; count, min, max and mean stay exact. WithPlan.Rawset, every record is kept and the percentiles are exact as before.BuildReportandFromRaware unchanged.
Added
report.Aggregator, an incremental alternative toBuildReport;record.Observerandrecord.NewStreamingCollector, aCollectorthat hands records to an observer instead of keeping them.
v0.1.1
Added
jotaro version(also-version/--version) prints the version. Release binaries report the release tag and commit;go install ...@vX.Y.Zreports the module version; other builds reportdev.
Fixed
- The GitHub Release is now published with the matching
CHANGELOG.mdsection as its notes. The v0.1.0 release was published with an empty body because the GoReleaser configuration skipped the release notes file.
v0.1.0
First public release.
Added
- Scenarios written as plain Go code (
Scenario/User/Step), with request builders (Get/Post/ ..., headers, query, JSON / form bodies,Decode,ExpectStatus) and think time. - Closed model (
Users) and open model (Rate/Ramp/Stages) load, with Coordinated Omission correction in the open model. FeederandLoadCSVto hand out per-user data.- Per-step latency (p50 / p90 / p95 / p99 / max), error breakdown, throughput, TTFB, DNS / TCP / TLS time and connection reuse rate; a per-second time series and the health of the load generator (CPU, goroutines).
- Reports as text, JSON and a self-contained HTML file; raw data as JSON Lines (
Plan.Raw). jotaroCLI:report,mergeandcheck(thresholds such asp95<200ms, exit code 1 when not met).jotaro mcp: an MCP server (stdio) that helps write scenarios. It serves the authoring guide and the threshold syntax as resources, awrite_scenarioprompt, and the toolscheck_scenario(syntax, jotaro-specific lint, type check; nothing is executed) andvalidate_threshold.THIRD_PARTY_NOTICES.md(license texts of the bundled modules) is included in the release archives.- Runs on Go 1.25 or later; CI on Linux, macOS and Windows.