public interface Registry extends Iterable<Metric>
| 限定符和类型 | 方法和说明 |
|---|---|
Clock |
clock()
The clock used by the registry for timing events.
|
Counter |
counter(Id id)
Measures the rate of some activity.
|
Id |
createId(String name)
Generate an identifier for a metric.
|
Id |
createId(String name,
Iterable<Tag> tags)
Generate an identifier for a metric.
|
Id |
createId(String name,
Map<String,String> tags) |
DistributionSummary |
distributionSummary(Id id)
Measures the rate and variation in amount for some activity.
|
<T extends Number> |
gauge(Id id,
Gauge<T> gauge)
Register a gauge instance
|
<X extends Metric> |
get(Id id)
Returns the metric associated with a given id.
|
<I,Y extends Info<I>> |
info(Id id,
Y info)
Register a info instance
|
Iterator<Metric> |
iterator()
Iterator for traversing the set of metrics in the registry.
|
MixinMetric |
mixinMetric(Id id)
Generate a mixinMetric
|
void |
propagate(String msg,
Throwable t)
propagate a exception
|
void |
register(Metric metric)
Add a custom metric to the registry.
|
void |
removeMetric(Id id)
Remove a metric by id.
|
Timer |
timer(Id id)
Measures the rate and time taken for short running tasks.
|
Clock clock()
Id createId(String name)
name - the name of an metric identifier.Id createId(String name, Iterable<Tag> tags)
name - the name of an metric identifier.tags - the tags of an metric identifier.void register(Metric metric)
caution: if the same id is already existed,then throw duplicate exception
metric - metric<T extends Number> Gauge<T> gauge(Id id, Gauge<T> gauge)
T - return old one;if this id first register gauge ,return nullid - metric idgauge - gaugevoid removeMetric(Id id)
id - metric id<I,Y extends Info<I>> Info info(Id id, Y info)
id - metric idinfo - an info instanceCounter counter(Id id)
id - metric idDistributionSummary distributionSummary(Id id)
id - metric idTimer timer(Id id)
id - metric idMixinMetric mixinMetric(Id id)
id - metric id<X extends Metric> X get(Id id)
if reaching the max number,null will be returned too.
id - metric idCopyright © 2018. All rights reserved.