You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, counter and gauge can be reset with set 0, but histogram doesn't have that functionality. I'm considering defining metrics as global variables, and it would be nice to reset metrics if necessary in tests
It follows the approach from your prototype (zeroing the bucket counts, sum, and count while preserving the bucket bounds via 0 <$ histBuckets), with one change: it uses atomicModifyIORef' instead of modifyIORef' to match observe/observeAndSample and stay safe against concurrent observations.
Currently, counter and gauge can be reset with
set 0, but histogram doesn't have that functionality. I'm considering defining metrics as global variables, and it would be nice to reset metrics if necessary in tests