Class FunctionCollectorRegistryImpl
- java.lang.Object
-
- io.prometheus.client.CollectorRegistry
-
- org.apache.pulsar.functions.instance.stats.FunctionCollectorRegistry
-
- org.apache.pulsar.functions.instance.stats.FunctionCollectorRegistryImpl
-
public class FunctionCollectorRegistryImpl extends FunctionCollectorRegistry
-
-
Constructor Summary
Constructors Constructor Description FunctionCollectorRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.prometheus.client.CollectorregisterIfNotExist(java.lang.String metricName, io.prometheus.client.Collector collector)Register a metric if it does not yet exist.-
Methods inherited from class org.apache.pulsar.functions.instance.stats.FunctionCollectorRegistry
getDefaultImplementation
-
-
-
-
Method Detail
-
registerIfNotExist
public io.prometheus.client.Collector registerIfNotExist(java.lang.String metricName, io.prometheus.client.Collector collector)Description copied from class:FunctionCollectorRegistryRegister a metric if it does not yet exist. If it does exist, then return the existing metric. Currently, only needed by the LocalRunner when running in threaded and exposing metrics via a http server. This method helps resolve the conflict in which multiple instances within the LocalRunner process try to register the same metric.- Specified by:
registerIfNotExistin classFunctionCollectorRegistry- Parameters:
metricName- the name of the metriccollector- the metric object e.g. Count, Gauge, etc.- Returns:
- If the metric with the name `metricName` already exists, return the existing metric object. If not, return null
-
-