public class ThreadSafeCounter extends Object implements Counter, Serializable
| 构造器和说明 |
|---|
ThreadSafeCounter(String name) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
dec()
Decrement the current count by 1.
|
void |
dec(long n)
Decrement the current count by the given value.
|
long |
getCount()
Returns the current count.
|
void |
inc()
Increment the current count by 1.
|
void |
inc(long n)
Increment the current count by the given value.
|
String |
name()
Returns the name of the associated metric.
|
void |
set(long n)
Sets the current value.
|
String |
toString() |
Unit |
unit()
Return the measurement unit for the associated metric.
|
public ThreadSafeCounter(String name)
public void inc(long n)
Counterpublic void dec(long n)
Counterpublic long getCount()
Counterpublic Unit unit()
MetricMetricTags.UNIT tag in the metric's description.Copyright © 2024 The Apache Software Foundation. All rights reserved.