-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix async interrupt breaking bookkeeping in a Summary #66
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ summary info quantiles_ = Metric $ do | |
|
||
instance Observer Summary where | ||
-- | Adds a new observation to a summary metric. | ||
observe s v = doIO $ withMVar (reqSketch s) (`ReqSketch.insert` v) | ||
observe s v = doIO $ withMVarMasked (reqSketch s) (\rs -> rs `ReqSketch.insert` v) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Add a comment explaining why we are masking here. Something along the lines of your PR description would be great. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on adding a comment directly to the code. |
||
|
||
-- | Retrieves a list of tuples containing a quantile and its associated value. | ||
getSummary :: MonadIO m => Summary -> m [(Rational, Double)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: What's the motivation for adding the
\rs -> rs
bit?No particular objections, just curious.