Package io.micrometer.core.instrument
Interface Counter
- All Superinterfaces:
Meter
- All Known Implementing Classes:
CumulativeCounter
,DropwizardCounter
,NoopCounter
,StepCounter
Counters monitor monotonically increasing values. Counters may never be reset to a
lesser value. If you need to track a value that goes up and down, use a
Gauge
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.core.instrument.Meter
Meter.Id, Meter.MeterProvider<T extends Meter>, Meter.Type
-
Method Summary
Modifier and TypeMethodDescriptionstatic Counter.Builder
double
count()
default void
Update the counter by one.void
increment
(double amount) Update the counter byamount
.default Iterable
<Measurement> measure()
Get a set of measurements.
-
Method Details
-
builder
-
increment
default void increment()Update the counter by one. -
increment
void increment(double amount) Update the counter byamount
.- Parameters:
amount
- Amount to add to the counter.
-
count
double count()- Returns:
- The cumulative count since this counter was created.
-
measure
Description copied from interface:Meter
Get a set of measurements. Should always return the same number of measurements and in the same order, regardless of the level of activity or the lack thereof.
-