public class ImmutableMetrics extends Object implements Metrics, Serializable
Metrics
implementation that cannot be modified.Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
annotations |
protected Map<String,AtomicLong> |
counts |
protected long |
durationNs |
protected String |
id |
protected String |
name |
protected Map<String,ImmutableMetrics> |
nested |
Modifier | Constructor and Description |
---|---|
protected |
ImmutableMetrics() |
Modifier and Type | Method and Description |
---|---|
Object |
getAnnotation(String key)
Obtain the annotation with the specified key.
|
Map<String,Object> |
getAnnotations()
Obtain the annotations for this Metrics.
|
Long |
getCount(String key)
Get the count for the corresponding countKey.
|
Map<String,Long> |
getCounts()
Get the map of all counters.
|
long |
getDuration(TimeUnit unit)
Get the duration of execution time taken.
|
String |
getId()
Id of this Metrics.
|
String |
getName()
Name of this Metrics.
|
Collection<ImmutableMetrics> |
getNested()
Get the nested Metrics objects.
|
ImmutableMetrics |
getNested(String metricsId)
Get a nested Metrics object by Id.
|
String |
toString() |
protected String id
protected String name
protected Map<String,AtomicLong> counts
protected long durationNs
protected final Map<String,ImmutableMetrics> nested
public long getDuration(TimeUnit unit)
Metrics
getDuration
in interface Metrics
public Long getCount(String key)
Metrics
public Map<String,Long> getCounts()
Metrics
public Collection<ImmutableMetrics> getNested()
Metrics
public ImmutableMetrics getNested(String metricsId)
Metrics
public Map<String,Object> getAnnotations()
Metrics
getAnnotations
in interface Metrics
public Object getAnnotation(String key)
Metrics
getAnnotation
in interface Metrics
key
- key of the annotation to obtain.Copyright © 2013–2018 Apache Software Foundation. All rights reserved.