diff --git a/api/src/main/java/org/eclipse/microprofile/metrics/Timer.java b/api/src/main/java/org/eclipse/microprofile/metrics/Timer.java index d2248a10..fcbd1116 100644 --- a/api/src/main/java/org/eclipse/microprofile/metrics/Timer.java +++ b/api/src/main/java/org/eclipse/microprofile/metrics/Timer.java @@ -28,8 +28,6 @@ /** * A timer metric which aggregates timing durations and provides duration statistics - * - * The timer measures duration in seconds. */ public interface Timer extends Metric, Sampling { /** diff --git a/api/src/main/java/org/eclipse/microprofile/metrics/annotation/Timed.java b/api/src/main/java/org/eclipse/microprofile/metrics/annotation/Timed.java index 24933ac6..c4ac9ebc 100644 --- a/api/src/main/java/org/eclipse/microprofile/metrics/annotation/Timed.java +++ b/api/src/main/java/org/eclipse/microprofile/metrics/annotation/Timed.java @@ -121,7 +121,7 @@ /** * The unit of the timer. * - * @return The unit of the timer. By default, the value is {@link MetricUnits#SECONDS}. + * @return The unit of the timer. By default, the value is {@link MetricUnits#NANOSECONDS}. * * @see org.eclipse.microprofile.metrics.Metadata * @see org.eclipse.microprofile.metrics.MetricUnits diff --git a/spec/src/main/asciidoc/app-programming-model.adoc b/spec/src/main/asciidoc/app-programming-model.adoc index c977781a..a747a2bf 100644 --- a/spec/src/main/asciidoc/app-programming-model.adoc +++ b/spec/src/main/asciidoc/app-programming-model.adoc @@ -99,11 +99,11 @@ The following Annotations exist, see below for common fields: |@Counted | M, C, T | Denotes a counter, which counts the invocations of the annotated object. | MetricUnits.NONE |@Gauge | M | Denotes a gauge, which samples the value of the annotated object. | _no default_, must be supplied by the user |@Metric | F, P | An annotation that contains the metadata information when requesting a metric to be injected. | MetricUnits.NONE -|@Timed | M, C, T | Denotes a timer, which tracks duration of the annotated object. | MetricUnits.SECONDS +|@Timed | M, C, T | Denotes a timer, which tracks duration of the annotated object. | MetricUnits.NANOSECONDS^1^ |=== -(C=Constructor, F=Field, M=Method, P=Parameter, T=Type) - +(C=Constructor, F=Field, M=Method, P=Parameter, T=Type) +^1^ Prometheus output will always display timer values in _seconds_. When using the `Timer` API to retrieve the `Snapshot`, the values returned from the `Snapshot` will be in nanoseconds. [cols="1,3,2"] |=== |Annotation | Description | Default