Skip to content

Commit

Permalink
Remove references to ConcurrentGauge, SimpleTimer and Meter + Timer n…
Browse files Browse the repository at this point in the history
…eeds to implement Metric interface
  • Loading branch information
Channyboy committed Jun 13, 2022
1 parent c1e4ab9 commit 3d36a98
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 56 deletions.
9 changes: 4 additions & 5 deletions api/src/main/java/org/eclipse/microprofile/metrics/Timer.java
Expand Up @@ -27,14 +27,11 @@
import java.util.concurrent.Callable;

/**
* A timer metric which aggregates timing durations and provides duration statistics, plus throughput statistics via
* {@link Meter}.
*
* See {@link SimpleTimer} for a lightweight alternative that only tracks elapsed time duration and count.
* A timer metric which aggregates timing durations and provides duration statistics
*
* The timer measures duration in nanoseconds.
*/
public interface Timer extends Sampling {
public interface Timer extends Metric, Sampling {
/**
* A timing context.
*
Expand Down Expand Up @@ -102,6 +99,8 @@ interface Context extends Closeable {
*/
Duration getElapsedTime();

long getCount();

@Override
Snapshot getSnapshot();
}
Expand Up @@ -74,11 +74,6 @@
*
* The counter value will only monotonically increase.
*
* <p>
* <b>Note:</b> the default behaviour has changed in MicroProfile Metrics 2.0. To get the old @Counted(monotonic=false)
* behavior, see @{@link ConcurrentGauge}
* </p>
*
* This annotation will throw an IllegalStateException if the constructor/method is invoked, but the metric no longer
* exists in the MetricRegistry.
*
Expand Down
Expand Up @@ -38,8 +38,6 @@
* An annotation for marking a method, constructor, or class as timed. The underlying
* {@link org.eclipse.microprofile.metrics.Timer Timer} metric aggregates timing durations and provides duration
* statistics, plus throughput statistics. There is a lightweight alternative
* {@link org.eclipse.microprofile.metrics.SimpleTimer SimpleTimer} (@{@link SimplyTimed}) that only tracks elapsed time
* duration and count. The metric will be registered in the application MetricRegistry.
* <p>
* Given a method annotated with {@literal @}Timed like this:
* </p>
Expand Down
Expand Up @@ -86,5 +86,5 @@
* </pre>
*
*/
@org.osgi.annotation.versioning.Version("4.0")
@org.osgi.annotation.versioning.Version("5.0")
package org.eclipse.microprofile.metrics.annotation;
Expand Up @@ -54,20 +54,6 @@
* </code>
* </pre>
*
* <p>
* {@link org.eclipse.microprofile.metrics.ConcurrentGauge ConcurrentGauge} is used to monitor the number of concurrent
* invocations of a component.
* <p>
* Example usage:
*
* <pre>
* <code>
* ConcurrentGauge cgauge = metricRegistry.concurrentGauge(metadata);
* cgauge.inc();
* // .. a block of code that can be executed by multiple threads at the same time
* cgauge.dec();
* </code>
* </pre>
*
* {@link org.eclipse.microprofile.metrics.Gauge Gauge} is used to provide the immediate measurement of a value.
* <p>
Expand All @@ -84,19 +70,6 @@
* </code>
* </pre>
*
*
* {@link org.eclipse.microprofile.metrics.Meter Meter} is used to measure the frequency of an event.
* <p>
* Example usage:
*
* <pre>
* <code>
* Meter meter = metricRegistry.meter(metadata);
* meter.mark();
* </code>
* </pre>
*
*
* {@link org.eclipse.microprofile.metrics.Histogram Histogram} is used to sample and compute the distribution of values
* <p>
* Example usage:
Expand All @@ -123,21 +96,6 @@
* context.close();
* </code>
* </pre>
*
* {@link org.eclipse.microprofile.metrics.SimpleTimer SimpleTimer} is used to measure the duration of an event.
* <p>
* Example usage:
*
* <pre>
* <code>
* SimpleTimer simpleTimer = metricRegistry.simpleTimer(metadata);
* SimpleTimer.Context context = simpleTimer.time();
*
* ... // code that will be timed
*
* context.close();
* </code>
* </pre>
*/
@org.osgi.annotation.versioning.Version("3.0")
@org.osgi.annotation.versioning.Version("5.0")
package org.eclipse.microprofile.metrics;

0 comments on commit 3d36a98

Please sign in to comment.