Comcast / jrugged

A Java libary of robustness design patterns
Apache License 2.0
266 stars 93 forks source link

Last{Minute,Hour,Day} metrics throw EmptySampleSetExceptions instead of returning 0. #6

Closed weggert closed 11 years ago

weggert commented 11 years ago

For the Last{Minute,Hour,Day} metrics (e.g. 99thPercentileSuccessLatencyLastMinute), if there has not been a sample in the specified time period a org.fishwife.jrugged.SampledQuantile$EmptySampleSetException is thrown when the value is requested.

This can be confusing. Some monitoring tools (SevOne, for example) will list a '--' value for the metric in this case. Also, causing even more confusion, monitoring tools will sometimes store the last known value and keep using it if a new value cannot be retrieved...resulting in a graph showing a steady value over time when there are actually no calls happening.

I believe that the Last{Minute,Hour,Day} stats should return 0 if there have been no matching requests. Perhaps we should only use the 'EmptySampleSetException' if there has been no data at all (ever)? The other alternative would be to have them report 0 if there have been no samples.

joercampbell commented 11 years ago

Closed with a pull request that changed the behavior to return the 0 being asked for here. Thanks Peter Cline for the patch.