These objects only increase in value
new()
PrometheusCounter$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 counter metric you are collecting
help
helper text to display to Prometheus
namespace
mechanism to scope counter name
label_names
the names of the labels.
instance of PrometheusCounter Getter for the type, which will always be 'counter'
getType()
PrometheusCounter$getType()
string of 'counter' Getter for the scoped name of the counter
This could include a concatenated namespace
getName()
PrometheusCounter$getName()
string of name text Getter for the helper text
getHelp()
PrometheusCounter$getHelp()
string of helper text Getter for the label names
getLabelNames()
PrometheusCounter$getLabelNames()
list of label names in the counter Getter for an adapter usaged key to include name, namespace, and label_names
getKey()
PrometheusCounter$getKey()
string to uniquely identify the counter Setter for the value of counter
set()
PrometheusCounter$set(value, labels = list())
value
value to set the counter to
labels
list of label values, which must match to the same number of label names increment the counter by a discrete value
incBy()
PrometheusCounter$incBy(value, labels = list())
value
value to implement the counter by
labels
list of label values, which must match to the same number of label names
my_counter$incBy(3) my_colors$incBy(3, list('red')) increment the counter by a 1
inc()
PrometheusCounter$inc(labels = list())
labels
list of label values, which must match to the same number of label names
my_counter$inc() my_colors$inc(list('red'))
clone()
The objects of this class are cloneable with this method.
PrometheusCounter$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 | ## ------------------------------------------------
## Method `PrometheusCounter$incBy`
## ------------------------------------------------
my_counter$incBy(3)
my_colors$incBy(3, list('red'))
increment the counter by a 1
## ------------------------------------------------
## Method `PrometheusCounter$inc`
## ------------------------------------------------
my_counter$inc()
my_colors$inc(list('red'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.