Class BaseMetricSettings<T extends BaseMetricSettings>
java.lang.Object
eu.rarogsoftware.rarog.platform.api.metrics.BaseMetricSettings<T>
- Type Parameters:
T
- child type
- Direct Known Subclasses:
HistogramSettings
,MetricSettings
Base for all metric settings containing common settings like name, description, etc.
It is convenience class. It cannot be instantiated directly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescription
(String description) Sets description.boolean
int
hashCode()
String[]
labels()
Ordered list of labels names, that will be required to provide to use metric.labels
(Collection<String> labels) Seelabels(String...)
.name()
Set name of metric.toString()
unit()
Unit of metric.
-
Constructor Details
-
BaseMetricSettings
public BaseMetricSettings()
-
-
Method Details
-
name
Set name of metric. It doesn't have any restriction, but some implementations may not accept all characters. Best to keep name passing [A-Za-z0-9_]* regex. Some characters like period `.` may be treated as special characters depending on implementation or metrics server.- Parameters:
name
- name of metric- Returns:
- settings object
-
description
Sets description. It not set will default to name.- Parameters:
description
- description of metric- Returns:
- settings object
-
labels
Ordered list of labels names, that will be required to provide to use metric. Labels are usually used to add dimensions to metric. It is especially useful when metric measures some functionality that may have different behaviours depending on input data or when you need to measure different aspect of functionality.- Parameters:
labels
- ordered list of labels- Returns:
- settings object
-
labels
Seelabels(String...)
.- Parameters:
labels
- ordered list of labels- Returns:
- settings object
-
unit
Unit of metric. Usually is used as suffix of reported metric name, but it may change depending on implementation.- Parameters:
unit
- unit of metric (e.g.: meters, bytes)- Returns:
- settings object
-
name
- Returns:
- name of metric
-
description
- Returns:
- description of metric
-
labels
- Returns:
- labels (dimentions) of metric
-
unit
- Returns:
- unit of metric
-
toString
-
equals
-
hashCode
public int hashCode()
-