Class MapLabels
java.lang.Object
io.nosqlbench.nb.api.labels.MapLabels
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new NBLabels value with the additional keys and values appended.Create a new NBLabels value with the additional keys and values appended.andDefault(NBLabels defaults) andDefault(String name, String value) asMap()Return a map representation of the label set, regardless of the underlying form.difference(NBLabels otherLabels) Subtract all matching labels from the other label set from this one, considering label names and values.booleaninthashCode()intersection(NBLabels otherLabels) Take the intersection of the two label sets, considering both key and value for each label entry.booleanisEmpty()Render a string representation of the label set according to the prometheus exposition naming format.linearize_bare(String... barewords) linearizeValues(char delim, String... included) Create a string representation of the label data, including only the values.modifyName(String nameToModify, Function<String, String> transform) Return a new NBLabels value with the specified key transformed according to the provided Lambda.modifyValue(String labelName, Function<String, String> transform) Return a new NBLabels value with the specified value transformed according to the provided Lambda.static StringtoString()Return the value of the specified label key.valueOfOptional(String name) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.nosqlbench.nb.api.labels.NBLabels
linearizeValues
-
Field Details
-
labels
-
-
Constructor Details
-
MapLabels
-
MapLabels
-
-
Method Details
-
linearizeValues
Description copied from interface:NBLabelsCreate a string representation of the label data, including only the values. Each value is concatenated with the others using the delim character. If a specified label name is included in square brackets like , then it is considered optional, and will be skipped over gracefully if it is not present in the label set. Otherwise all names are considered required.- Specified by:
linearizeValuesin interfaceNBLabels- Parameters:
delim- A single characterincluded- Which fields from the label set to include in the rendered string. If none are specified then all are included.- Returns:
- A string representation of the labels
-
linearize_bare
- Specified by:
linearize_barein interfaceNBLabels
-
linearize
Description copied from interface:NBLabelsRender a string representation of the label set according to the prometheus exposition naming format. This means that a label set which includes the JSON data:
would render to{ "name": "fooname", "label1": "label1value" }
IF called asfooname{label1="label1value"}linearize("name").The included fields are added to the label set. If none are specified then all are included by default.
-
linearizeAsMetrics
- Specified by:
linearizeAsMetricsin interfaceNBLabels
-
linearizeAsKvString
- Specified by:
linearizeAsKvStringin interfaceNBLabels
-
sanitize
-
and
Description copied from interface:NBLabelsCreate a new NBLabels value with the additional keys and values appended. -
andDefault
- Specified by:
andDefaultin interfaceNBLabels
-
andDefault
- Specified by:
andDefaultin interfaceNBLabels
-
and
-
modifyName
Description copied from interface:NBLabelsReturn a new NBLabels value with the specified key transformed according to the provided Lambda. The associated value is not modified.- Specified by:
modifyNamein interfaceNBLabels- Parameters:
nameToModify- The key to modifytransform- A Lambda which will modify the existing key name.- Returns:
- A new NBLabels value, separate from the original
-
modifyValue
Description copied from interface:NBLabelsReturn a new NBLabels value with the specified value transformed according to the provided Lambda. The associated key name is not modified.- Specified by:
modifyValuein interfaceNBLabels- Parameters:
labelName- The named label to modifytransform- A Lambda which will modify the existing value.- Returns:
- A new NBLabels value, separate from the original
-
toString
-
valueOf
-
valueOfOptional
- Specified by:
valueOfOptionalin interfaceNBLabels
-
asMap
-
and
-
equals
-
hashCode
-
intersection
Take the intersection of the two label sets, considering both key and value for each label entry. If both have the same label name but different values for it, then that label is not considered common and it is not retained in the intersection.- Specified by:
intersectionin interfaceNBLabels- Parameters:
otherLabels- The label set to intersect- Returns:
- a String
-
difference
Subtract all matching labels from the other label set from this one, considering label names and values. If the other label set contains the same name but a different value, then it is not considered a match and thus not removed from the labels of this element.- Specified by:
differencein interfaceNBLabels- Parameters:
otherLabels- Labels to remove, where key and value matches- Returns:
- The same, or a smaller set of labels for this element
-
isEmpty
-