Skip to content

Fixes Histogram decorator usage (#140)#141

Closed
jcaxmacher wants to merge 1 commit into
prometheus:masterfrom
jcaxmacher:master
Closed

Fixes Histogram decorator usage (#140)#141
jcaxmacher wants to merge 1 commit into
prometheus:masterfrom
jcaxmacher:master

Conversation

@jcaxmacher

Copy link
Copy Markdown

Without creating a new instance of _HistogramTimer for each call, the internal timer is reused across executions of the instrumented function. This results in erroneous timings. The solution is to create a new _HistogramTimer for each execution of the decorated function. This provides the same behavior as using the Histogram.time() as a decorator within the instrumented function.

Without creating a new instance of `_HistogramTimer` for each call, the internal timer is reused across executions of the instrumented function.  This results in erroneous timings.  The solution is to create a new `_HistogramTimer` for each execution of the decorated function.  This provides the same behavior as using the `Histogram.time()` as a decorator within the instrumented function.
@brian-brazil

Copy link
Copy Markdown
Contributor

Closing per #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants