public class Prometheus
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
counterBuild(java.lang.String name,
java.lang.String help)
Builds a new Prometheus Counter metric, if possible.
|
static void |
counterInc(java.lang.Object counter)
Increments the value in the Prometheus Counter by 1, if possible.
|
static java.lang.Object |
gaugeBuild(java.lang.String name,
java.lang.String help)
Builds a new Prometheus Gauge metric, if possible.
|
static void |
gaugeDec(java.lang.Object gauge)
Decrements the value in the Prometheus Gauge by 1, if possible.
|
static double |
gaugeGet(java.lang.Object gauge)
Gets the current value stored in the Prometheus Gauge, if possible.
|
static void |
gaugeInc(java.lang.Object gauge)
Increments the value in the Prometheus Gauge by 1, if possible.
|
static void |
gaugeSet(java.lang.Object gauge,
double val)
Sets the Prometheus Gauge to a given value, if possible.
|
static boolean |
havePrometheus()
Getter method for this.havePrometheus
|
static double |
observeDuration(java.lang.Object timer)
Observe duration on a Prometheus timer.
|
static java.lang.Object |
startTimer(java.lang.Object summary,
java.lang.String... labels)
Start a timer on a summary metric to track a duration
Call
observeDuration(Object) at the end of what you want to measure the duration of. |
static java.lang.Object |
summaryBuild(java.lang.String name,
java.lang.String help,
java.lang.String... labels)
Builds and returns a new Prometheus Summary object, if possible.
|
public static java.lang.Object summaryBuild(java.lang.String name,
java.lang.String help,
java.lang.String... labels)
name - The name of the metrichelp - The help string of the metriclabels - The label to attach to the metricpublic static java.lang.Object startTimer(@Nullable
java.lang.Object summary,
java.lang.String... labels)
observeDuration(Object) at the end of what you want to measure the duration of.summary - The Summary metric to start the timer onlabels - The labels to attachpublic static double observeDuration(@Nullable
java.lang.Object timer)
timer - The prometheus timer.public static java.lang.Object gaugeBuild(java.lang.String name,
java.lang.String help)
name - The name of the metrichelp - The help string of the metricpublic static double gaugeGet(java.lang.Object gauge)
gauge - The instance of the gaugepublic static void gaugeSet(java.lang.Object gauge,
double val)
public static void gaugeInc(java.lang.Object gauge)
public static void gaugeDec(java.lang.Object gauge)
public static java.lang.Object counterBuild(java.lang.String name,
java.lang.String help)
name - The name of the metrichelp - The help string of the metricpublic static void counterInc(java.lang.Object counter)
public static boolean havePrometheus()