Package org.acemq.rabbitmq.admin.metrics
Class MetricSample
java.lang.Object
org.acemq.rabbitmq.admin.metrics.MetricSample
One measurement: a metric name, its labels, and a number.
The unit of everything in a Prometheus scrape. rabbitmq_detailed_queue_messages_ready
with {vhost="/", queue="orders.new"} and the value 42 is one sample; the same
metric for another queue is a different sample with the same name.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MetricSample
-
-
Method Details
-
name
- Returns:
- the metric name, without labels
-
labels
- Returns:
- the labels, in the order the broker wrote them
-
label
- Parameters:
name- a label- Returns:
- its value, or empty when this sample does not carry it. Absent rather than null, because the aggregate endpoint publishes the same metric names with no labels at all and code written against the detailed endpoint would otherwise fail on the wrong one
-
queue
- Returns:
- the queue this sample is about, when it is about one
-
value
public double value()- Returns:
- the value
-
asLong
public long asLong()- Returns:
- the value as a whole number, which is what a count or a depth always is
-
toString
-