mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Two fixes: 1. Measure request latency in the response callback instead of when `collect_request` drains the in-flight deque. Previously the `Stopwatch` ran from submission until collection, which at high `pipeline_depth` included time the request sat completed in the deque waiting to be collected. Now a shared `Stopwatch` is captured by the callback and read when the response actually arrives. 2. Compute RPS using wall-clock elapsed time (`Stopwatch`) instead of deriving it from `sum(individual_latencies) / concurrency`. The old formula did not account for pipelining: with `pipeline_depth=64` it reported ~2k RPS while actual wall-clock throughput was ~140k RPS. `getThroughput` now takes elapsed seconds directly, and the `concurrency` parameter is removed from `report` and `writeJSON`. Co-Authored-By: Claude Opus 4.6 <[email protected]>