Skip to content

pulsar-perf reports throughput and latency every 10 seconds, as Java's does - #53

Merged
merlimat merged 1 commit into
mainfrom
perf-periodic-reports
Nov 24, 2026
Merged

merlimat merged 1 commit into
mainfrom
perf-periodic-reports

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

pulsar-perf produce and pulsar-perf consume print only their Aggregated lines at the end of a run. Java's pulsar-perf also prints a line every 10 seconds, so a run's progress, stalls and latency drift show while it goes. This adds those lines, in Java's format:

… INFO pulsar_perf: Throughput produced:   10003 msg ---    999.8 msg/s ---      7.8 Mbit/s --- failure      0.0 msg/s --- Latency: mean:   2.875 ms - med:   2.837 - 95pct:   3.863 - 99pct:   4.315 - 99.9pct:   6.335 - 99.99pct:  10.431 - Max:  10.431
… INFO pulsar_perf: Throughput received:  372345 msg --- 37232.103 msg/s --- 290.876 Mbit/s --- Latency: mean: 182637.705 ms - med: 182783 - 95pct: 186879 - 99pct: 187263 - 99.9pct: 187263 - 99.99pct: 187263 - Max: 187263
  • Each line counts the messages so far, the msg/s and Mbit/s since the last report, and the percentiles of an HdrHistogram of that interval, reset after each report. The Aggregated lines still come from the run's own histogram.
  • The producer's latency is the send's, past the warm-up. The consumer's is new: it runs from the publish time, in whole milliseconds, as Java's.
  • failure is always 0.0: a failed send ends the run.
  • The reports come from a thread of their own, which waits on a channel the run drops at its end, as Java's main thread waits on its latch. A first version on a timer of the runtime cost the consume loop about 6% of its throughput; the thread costs nothing measurable.
  • All output now goes through tracing, at INFO unless RUST_LOG says otherwise, with the client's own logs, as Java's pulsar-perf shows the Java client's. baseline.sh still finds the Aggregated lines behind the prefix.

Still different from Java's: the producer's Aggregated latency line has no 99.999pct, and the consumer has no Aggregated latency line nor AckRate.

Testing

Unit tests cover both lines and the intervals, an empty one included. Against a 5.0.1 standalone: produce at full rate and at 1000 msg/s, consume from a backlog and from an empty topic, each on the thread-safe and the local client, and a bad service URL. Consume throughput over three alternating runs on a fresh broker: 71.0k msg/s before, 71.1k after.

…s does

`pulsar-perf produce` and `pulsar-perf consume` print a line every 10 seconds, in Java's format: the messages so far,
the msg/s and Mbit/s since the last report, and the latency percentiles of an HdrHistogram of that interval, reset
after each report. The producer's latency is the send's, past the warm-up; the consumer's runs from the publish time,
in whole milliseconds. The reports come from a thread of their own, as Java's main thread prints them: a timer on the
runtime cost the consume loop about 6% of its throughput.

All output now goes through `tracing`, at INFO unless `RUST_LOG` says otherwise, with the client's own logs.
@merlimat
merlimat merged commit 6b5e8da into main Nov 24, 2026
15 checks passed
@merlimat
merlimat deleted the perf-periodic-reports branch November 24, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant