Skip to content

Conversation

@yarosla
Copy link
Contributor

@yarosla yarosla commented Apr 21, 2018

@brian-brazil Recreated #368 from squashed branch + signed-off

Another usability enhancement allowing instead of:

String v;
try (Summary.Timer timer = summary.startTimer()) {
  v = someMethod();
}

to write:

String v = summary.time(this::someMethod);

This is especially useful when programming (reactive) streams.

Trying to make metric code as unobtrusive as possible.

BTW Micrometer already does that.

allow Gauges to time Callables + small fix in javadocs

Signed-off-by: Yaroslav Stavnichiy <yarosla@gmail.com>
@brian-brazil brian-brazil merged commit 40d179d into prometheus:master Apr 23, 2018
@brian-brazil
Copy link
Contributor

Thanks!

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