I reckon that one easy fix would be to configure the samples and sample age to 
be super high...

Or I could make the metrics fully deterministic with MockTime, but that seems a 
little overkill. I don't need to test that the stats themselves compute what 
they claim to compute. I am more attempting to verify:
1. I have in fact recorded the metrics, with the proper names
2. I recorded the correct values (i.e., I didn't use the current time in place 
of the latency, or a latency as a number of occurrences, etc.)
3. I *probably* selected the right stats (i.e., I didn't use a Total when I 
meant to use a Max, etc.)

For these purposes, I think it's sufficient to:
1. check that the metrics are present and non-zero
2. check that the values are in the right ballpark, although when it's easy to 
see what the exact value should be, that's nicer.

[ Full content available at: https://github.com/apache/kafka/pull/5742 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

Reply via email to