Class BaseMetricCollector<T,I extends io.prometheus.client.SimpleCollector<?>>
java.lang.Object
org.jenkinsci.plugins.prometheus.collectors.BaseMetricCollector<T,I>
- All Implemented Interfaces:
MetricCollector<T,I>
- Direct Known Subclasses:
BuildsMetricCollector,DiskUsageBytesGauge,DiskUsageFileCountGauge,ExecutorsAvailableGauge,ExecutorsBusyGauge,ExecutorsConnectingGauge,ExecutorsDefinedGauge,ExecutorsIdleGauge,ExecutorsOnlineGauge,ExecutorsQueueLengthGauge,FileStoreAvailableGauge,FileStoreCapacityGauge,JenkinsQuietDownGauge,JenkinsUpGauge,JenkinsUptimeGauge,JenkinsVersionInfo,JobUsageBytesGauge,NodesOfflineCauseGauge,NodesOnlineGauge
public abstract class BaseMetricCollector<T,I extends io.prometheus.client.SimpleCollector<?>>
extends Object
implements MetricCollector<T,I>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseMetricCollector(String[] labelNames, String namespace, String subsystem) protectedBaseMetricCollector(String[] labelNames, String namespace, String subsystem, String namePrefix) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcalculateMetric(T jenkinsObject, String[] labelValues) This method contains the logic to calculate a metric value based on the given Jenkins object (e.g.Calling this method will return the resulting name of the metric with base name and prefixList<io.prometheus.client.Collector.MetricFamilySamples> collect()Calling this method basically calls I.collect()protected Stringprotected abstract io.prometheus.client.SimpleCollector.Builder<?, I> protected abstract CollectorTypeprotected abstract Stringprotected I
-
Field Details
-
SEPARATOR
- See Also:
-
labelNames
-
namespace
-
subsystem
-
namePrefix
-
collector
-
-
Constructor Details
-
BaseMetricCollector
-
BaseMetricCollector
-
-
Method Details
-
getCollectorType
- Returns:
- - the name of the collector without subsystem, namespace, prefix
-
getHelpText
- Returns:
- - the help text which should be displayed
-
getCollectorBuilder
- Returns:
- - builder object of the type of collector
-
initCollector
-
collect
Description copied from interface:MetricCollectorCalling this method basically calls I.collect()- Specified by:
collectin interfaceMetricCollector<T,I extends io.prometheus.client.SimpleCollector<?>>
-
calculateName
Description copied from interface:MetricCollectorCalling this method will return the resulting name of the metric with base name and prefix- Specified by:
calculateNamein interfaceMetricCollector<T,I extends io.prometheus.client.SimpleCollector<?>> - Returns:
- the full name of the collector
-
getBaseName
-
calculateMetric
Description copied from interface:MetricCollectorThis method contains the logic to calculate a metric value based on the given Jenkins object (e.g. Job, Run,...)- Specified by:
calculateMetricin interfaceMetricCollector<T,I extends io.prometheus.client.SimpleCollector<?>> - Parameters:
jenkinsObject- - Examples:Job,RunlabelValues- - The label values for the calculation
-