public static class Meter.Id
extends java.lang.Object
Constructor and Description |
---|
Id(java.lang.String name,
java.lang.Iterable<Tag> 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() |
Meter.Type |
getType()
The type is used by different registry implementations to structure the exposition
of metrics to different backends.
|
int |
hashCode() |
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.
|
public Id(java.lang.String name, java.lang.Iterable<Tag> 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 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()
@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()