Is there a way to get realtime stats that give latency stats buckets only between checkpoints
Hi Ashu,
You can’t query a range with $collStats histogram output.
The output format is bucketed in operation latencies.
For example:
{ micros: NumberLong(1), count: NumberLong(10) },
{ micros: NumberLong(2), count: NumberLong(1) },
Indicates:
10 operations taking 1 microsecond or less,
1 operation in the range (1, 2] microseconds.
Having said that, it’s part of aggregation pipeline, and depending on your use case you may modify the output accordingly by adding extra pipeline stages. i.e. remove the highest read value from the array.
Alternatively, if you’re interested in building a time based (checkpoints) graph, you could poll the server by running serverStatus calls. Gathering the latencies information from the opLatencies section to build up your own timeseries data.
Regards,
Wan.