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>

public class BuildTotalCounter extends BuildsMetricCollector<Run<?,?>,io.prometheus.client.Counter>
  • Constructor Details

    • BuildTotalCounter

      protected BuildTotalCounter(String[] labelNames, String namespace, String subsystem)
    • BuildTotalCounter

      protected BuildTotalCounter(String[] labelNames, String namespace, String subsystem, String prefix)
  • Method Details

    • getCollectorType

      protected CollectorType getCollectorType()
      Specified by:
      getCollectorType in class BaseMetricCollector<Run<?,?>,io.prometheus.client.Counter>
      Returns:
      - the name of the collector without subsystem, namespace, prefix
    • getHelpText

      protected String getHelpText()
      Specified by:
      getHelpText in class BaseMetricCollector<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 class BaseMetricCollector<Run<?,?>,io.prometheus.client.Counter>
      Returns:
      - builder object of the type of collector
    • calculateMetric

      public void calculateMetric(Run<?,?> jenkinsObject, String[] labelValues)
      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 interface MetricCollector<Run<?,?>,io.prometheus.client.Counter>
      Specified by:
      calculateMetric in class BaseMetricCollector<Run<?,?>,io.prometheus.client.Counter>
      Parameters:
      jenkinsObject - - Examples: Job, Run
      labelValues - - The label values for the calculation