Gauges differ from Counters as they can decrease in value
new()
PrometheusGauge$new( storage_adapter, name, help, namespace = NULL, label_names = list() )
storage_adapter
instance of the storage adapter to how you want to persist metrics
name
name of the gauge metric you are collecting
help
helper text to display to Prometheus
namespace
mechanism to scope gauge name
label_names
the names of the labels.
instance of PrometheusGauge Getter for the type, which will always be 'gauge'
getType()
PrometheusGauge$getType()
string of 'gauge' Getter for the scoped name of the gauge
This could include a concatenated namespace
getName()
PrometheusGauge$getName()
string of name text Getter for the helper text
getHelp()
PrometheusGauge$getHelp()
string of helper text Getter for the label names
getLabelNames()
PrometheusGauge$getLabelNames()
list of label names in the gauge Getter for an adapter usaged key to include name, namespace, and label_names
getKey()
PrometheusGauge$getKey()
string to uniquely identify the gauge Setter for the value of gauge
set()
PrometheusGauge$set(value, labels = list())
value
value to set the gauge to
labels
list of label values, which must match to the same number of label names increment the gauge by a discrete value
incBy()
PrometheusGauge$incBy(value, labels = list())
value
value to implement the gauge by
labels
list of label values, which must match to the same number of label names
my_gauge$incBy(3) my_colors$incBy(3, list('red')) increment the gauge by a 1
inc()
PrometheusGauge$inc(labels = list())
labels
list of label values, which must match to the same number of label names
my_gauge$inc() my_colors$inc(list('red')) decrement the gauge by a discrete value
decBy()
PrometheusGauge$decBy(value, labels = list())
value
value to decrement the gauge by. Should be a positive number
labels
list of label values, which must match to the same number of label names
my_gauge$decBy(3) my_colors$decBy(3, list('red')) decrement the gauge by a 1
dec()
PrometheusGauge$dec(labels = list())
labels
list of label values, which must match to the same number of label names
my_gauge$dec() my_colors$dec(list('red'))
clone()
The objects of this class are cloneable with this method.
PrometheusGauge$clone(deep = FALSE)
deep
Whether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## ------------------------------------------------
## Method `PrometheusGauge$incBy`
## ------------------------------------------------
my_gauge$incBy(3)
my_colors$incBy(3, list('red'))
increment the gauge by a 1
## ------------------------------------------------
## Method `PrometheusGauge$inc`
## ------------------------------------------------
my_gauge$inc()
my_colors$inc(list('red'))
decrement the gauge by a discrete value
## ------------------------------------------------
## Method `PrometheusGauge$decBy`
## ------------------------------------------------
my_gauge$decBy(3)
my_colors$decBy(3, list('red'))
decrement the gauge by a 1
## ------------------------------------------------
## Method `PrometheusGauge$dec`
## ------------------------------------------------
my_gauge$dec()
my_colors$dec(list('red'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.