eclipse/microprofile-metrics

API: update package-info related to Timers

donbourne opened this issue · 0 comments

for Timers the javadoc currently says:
is used to measure the duration of an event as well as the frequency of occurrence.
...but Timers no longer measure frequency of occurrence

also, the example for Timers should use a try-with-resource block to be more useful

current:

 *     Timer timer = metricRegistry.timer(metadata);
 *     Timer.Context context = timer.time();
 *
 *     ... // code that will be timed
 *
 *     context.close();

proposed:

        Timer timer = metricRegistry.timer(metadata);
        try (Timer.Context context = timer.time()) {
            ... // code that will be timed
        }