public static class Meter.Id
extends java.lang.Object
Constructor and Description |
---|
Id(java.lang.String name,
Tags tags,
java.lang.String baseUnit,
java.lang.String description,
Meter.Type type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getBaseUnit() |
java.lang.String |
getConventionName(NamingConvention namingConvention) |
java.util.List<Tag> |
getConventionTags(NamingConvention namingConvention)
Tags that are sorted by key and formatted
|
java.lang.String |
getDescription() |
java.lang.String |
getName() |
java.lang.String |
getTag(java.lang.String key) |
java.util.List<Tag> |
getTags() |
java.lang.Iterable<Tag> |
getTagsAsIterable() |
Meter.Type |
getType()
The type is used by different registry implementations to structure the exposition
of metrics to different backends.
|
int |
hashCode() |
Meter.Id |
replaceTags(java.lang.Iterable<Tag> tags)
Generate a new id replacing all tags with new ones.
|
Meter.Id |
syntheticAssociation()
For internal use.
|
java.lang.String |
toString() |
Meter.Id |
withBaseUnit(java.lang.String newBaseUnit)
Generate a new id with a different base unit.
|
Meter.Id |
withName(java.lang.String newName)
Generate a new id with a different name.
|
Meter.Id |
withTag(Statistic statistic)
Generate a new id with an additional tag with a tag key of "statistic".
|
Meter.Id |
withTag(Tag tag)
Generate a new id with an additional tag.
|
Meter.Id |
withTags(java.lang.Iterable<Tag> tags)
Generate a new id with an additional tag.
|
public Id(java.lang.String name, Tags tags, @Nullable java.lang.String baseUnit, @Nullable java.lang.String description, Meter.Type type)
public Meter.Id withName(java.lang.String newName)
newName
- The new name.public Meter.Id withTag(Tag tag)
tag
- The tag to add.public Meter.Id withTags(java.lang.Iterable<Tag> tags)
tags
- The tag to add.public Meter.Id replaceTags(java.lang.Iterable<Tag> tags)
tags
- The tag to add.public Meter.Id withTag(Statistic statistic)
statistic
- The statistic tag to add.public Meter.Id withBaseUnit(@Nullable java.lang.String newBaseUnit)
newBaseUnit
- The base unit of the new id.public java.lang.String getName()
public java.util.List<Tag> getTags()
public java.lang.Iterable<Tag> getTagsAsIterable()
@Nullable public java.lang.String getTag(java.lang.String key)
key
- The tag key to attempt to match.null
if no tag with the provided key exists on this id.@Nullable public java.lang.String getBaseUnit()
public java.lang.String getConventionName(NamingConvention namingConvention)
namingConvention
- The naming convention used to normalize the id's name.public java.util.List<Tag> getConventionTags(NamingConvention namingConvention)
namingConvention
- The naming convention used to normalize the id's name.@Nullable public java.lang.String getDescription()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Meter.Type getType()
@Nullable public Meter.Id syntheticAssociation()
HistogramGauges
are derivatives
of a Timer
or DistributionSummary
.
This method may be removed in future minor or major releases if we find a way to mark derivatives in a private way that does not have other API compatibility consequences.