Since the basic runtime routines have already been implemented, we should display some statistics during the benchmark. This PR introduces a stats module responsible for collecting and printing formatted statistics.
LatencyCalculator trait with two implementations - one calculating raw latencies (end - start), and the other calculating coordinated-omission-fixed latencies (end - scheduled_start). This trait is used by Stats structure to keep track of the recorded latencies, based on the type of the latency provided by the user (-rate fixed CLI boolean flag).
StatsPrinter structure responsible for displaying formatted benchmark statistics
Adjusted Read/WriteOperation to record the results of the operations to the Stats structure
Extended main logic to display formatted statistics periodically. By default, the display interval is 1 second - for now it's hardcoded but left as a TODO to adjust when -log option (interval parameter) is supported.
Motivation
Since the basic runtime routines have already been implemented, we should display some statistics during the benchmark. This PR introduces a
stats
module responsible for collecting and printing formatted statistics.Changes
stats
module with:Stats
structure implementingcql_stress::sharded_stats::Stats
StatsFactory
structure implementingcql_stress::sharded_stats::StatsFactory
LatencyCalculator
trait with two implementations - one calculating raw latencies (end
-start
), and the other calculating coordinated-omission-fixed latencies (end
-scheduled_start
). This trait is used byStats
structure to keep track of the recorded latencies, based on the type of the latency provided by the user (-rate fixed
CLI boolean flag).StatsPrinter
structure responsible for displaying formatted benchmark statisticsRead/WriteOperation
to record the results of the operations to theStats
structuremain
logic to display formatted statistics periodically. By default, the display interval is 1 second - for now it's hardcoded but left as a TODO to adjust when-log
option (interval
parameter) is supported.