Class BuildTotalCounter
java.lang.Object
org.jenkinsci.plugins.prometheus.collectors.BaseMetricCollector<T,I>
org.jenkinsci.plugins.prometheus.collectors.builds.BuildsMetricCollector<Run<?,?>,io.prometheus.client.Counter>
org.jenkinsci.plugins.prometheus.collectors.builds.BuildTotalCounter
- All Implemented Interfaces:
MetricCollector<Run<?,
?>, io.prometheus.client.Counter>
-
Field Summary
Fields inherited from class org.jenkinsci.plugins.prometheus.collectors.BaseMetricCollector
collector, labelNames, namePrefix, namespace, SEPARATOR, subsystem
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BuildTotalCounter
(String[] labelNames, String namespace, String subsystem) protected
BuildTotalCounter
(String[] labelNames, String namespace, String subsystem, String prefix) -
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateMetric
(Run<?, ?> jenkinsObject, String[] labelValues) This method contains the logic to calculate a metric value based on the given Jenkins object (e.g.protected io.prometheus.client.SimpleCollector.Builder<?,
io.prometheus.client.Counter> protected CollectorType
protected String
Methods inherited from class org.jenkinsci.plugins.prometheus.collectors.builds.BuildsMetricCollector
getBaseName
Methods inherited from class org.jenkinsci.plugins.prometheus.collectors.BaseMetricCollector
calculateName, collect, initCollector
-
Constructor Details
-
BuildTotalCounter
-
BuildTotalCounter
-
-
Method Details
-
getCollectorType
- Specified by:
getCollectorType
in classBaseMetricCollector<Run<?,
?>, io.prometheus.client.Counter> - Returns:
- - the name of the collector without subsystem, namespace, prefix
-
getHelpText
- Specified by:
getHelpText
in classBaseMetricCollector<Run<?,
?>, io.prometheus.client.Counter> - Returns:
- - the help text which should be displayed
-
getCollectorBuilder
protected io.prometheus.client.SimpleCollector.Builder<?,io.prometheus.client.Counter> getCollectorBuilder()- Specified by:
getCollectorBuilder
in classBaseMetricCollector<Run<?,
?>, io.prometheus.client.Counter> - Returns:
- - builder object of the type of collector
-
calculateMetric
Description copied from interface:MetricCollector
This method contains the logic to calculate a metric value based on the given Jenkins object (e.g. Job, Run,...)- Specified by:
calculateMetric
in interfaceMetricCollector<Run<?,
?>, io.prometheus.client.Counter> - Specified by:
calculateMetric
in classBaseMetricCollector<Run<?,
?>, io.prometheus.client.Counter> - Parameters:
jenkinsObject
- - Examples:Job
,Run
labelValues
- - The label values for the calculation
-