|
|
|
@ -50,6 +50,10 @@ A good example is of an elevator that tracks how many times it has been used in |
|
|
|
its duty cycle. Each time someone hits the button to dispatch it, the elevator |
|
|
|
its duty cycle. Each time someone hits the button to dispatch it, the elevator |
|
|
|
can update its tally; and this is a tally it keeps! |
|
|
|
can update its tally; and this is a tally it keeps! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See also the [counter Javadoc](https://github.com/prometheus/client_java/blob/master/client/src/main/java/io/prometheus/client/metrics/Counter.java) |
|
|
|
|
|
|
|
in Prometheus' Java client library for further documentation and concrete code |
|
|
|
|
|
|
|
examples. |
|
|
|
|
|
|
|
|
|
|
|
## Gauges |
|
|
|
## Gauges |
|
|
|
|
|
|
|
|
|
|
|
A _Gauge_ reports instantaneous values based on external state. This is |
|
|
|
A _Gauge_ reports instantaneous values based on external state. This is |
|
|
|
@ -66,6 +70,10 @@ The following are good examples or applications of gauges: |
|
|
|
Unlike a _Counter_, you don't have direct access to the events that brought the |
|
|
|
Unlike a _Counter_, you don't have direct access to the events that brought the |
|
|
|
_Gauge_ to its value today. This is a white-box and black-box distinction. |
|
|
|
_Gauge_ to its value today. This is a white-box and black-box distinction. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See also the [gauge Javadoc](https://github.com/prometheus/client_java/blob/master/client/src/main/java/io/prometheus/client/metrics/Gauge.java) |
|
|
|
|
|
|
|
in Prometheus' Java client library for further documentation and concrete code |
|
|
|
|
|
|
|
examples. |
|
|
|
|
|
|
|
|
|
|
|
## Which to use: Counter or Gauge? |
|
|
|
## Which to use: Counter or Gauge? |
|
|
|
Knowing whether to use a _Counter_ or a _Gauge_ can be tough. Let's perform a |
|
|
|
Knowing whether to use a _Counter_ or a _Gauge_ can be tough. Let's perform a |
|
|
|
practical thought exercise. Below is an image of an automobile's instrument |
|
|
|
practical thought exercise. Below is an image of an automobile's instrument |
|
|
|
@ -121,5 +129,9 @@ This is quite convenient, for if you are interested in tracking latencies of an |
|
|
|
operation in real time, you get three types of information reported for free |
|
|
|
operation in real time, you get three types of information reported for free |
|
|
|
with one metric. |
|
|
|
with one metric. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See also the [summary Javadoc](https://github.com/prometheus/client_java/blob/master/client/src/main/java/io/prometheus/client/metrics/Summary.java) |
|
|
|
|
|
|
|
in Prometheus' Java client library for further documentation and concrete code |
|
|
|
|
|
|
|
examples. |
|
|
|
|
|
|
|
|
|
|
|
# Acknowledgements |
|
|
|
# Acknowledgements |
|
|
|
Robert Bray: Vehicle Instrument Panel |
|
|
|
Robert Bray: Vehicle Instrument Panel |
|
|
|
|