@Test public void shouldNotFailWhenCleaningNonAlreadyRegisteredPartition() { PrometheusMetrics.clearPartitionCollectors(0); }
public static void clearPartitionCollectors(int partition) { Map<SimpleCollector<?>, Set<List<String>>> collectorToChildLabels = REGISTERED_COLLECTORS.get(partition); if (collectorToChildLabels != null) { collectorToChildLabels.forEach((collector, childLabels) -> childLabels.forEach(labels -> collector.remove(labels.toArray(new String[0])))); } }
PrometheusMetrics { public static void clearPartitionCollectors(int partition) { Map<SimpleCollector<?>, Set<List<String>>> collectorToChildLabels = REGISTERED_COLLECTORS.get(partition); if (collectorToChildLabels != null) { collectorToChildLabels.forEach((collector, childLabels) -> childLabels.forEach(labels -> collector.remove(labels.toArray(new String[0])))); } } }
PrometheusMetrics { public static void clearPartitionCollectors(int partition) { Map<SimpleCollector<?>, Set<List<String>>> collectorToChildLabels = REGISTERED_COLLECTORS.get(partition); if (collectorToChildLabels != null) { collectorToChildLabels.forEach((collector, childLabels) -> childLabels.forEach(labels -> collector.remove(labels.toArray(new String[0])))); } } private  PrometheusMetrics(); }
PrometheusMetrics { public static void clearPartitionCollectors(int partition) { Map<SimpleCollector<?>, Set<List<String>>> collectorToChildLabels = REGISTERED_COLLECTORS.get(partition); if (collectorToChildLabels != null) { collectorToChildLabels.forEach((collector, childLabels) -> childLabels.forEach(labels -> collector.remove(labels.toArray(new String[0])))); } } private  PrometheusMetrics(); static Counter.Child tmpFileOpenFailuresCounter(String eventName); static Counter.Child tmpFilesOpened(String eventName); static Counter.Child filesCommittedCounter(String eventName); static Counter.Child checkpointFailuresCounter(String eventName, int partition); static Counter.Child checkpointSuccessesCounter(String eventName, int partition); static Counter.Child messageWritingFailuresCounter(String eventName, int partition); static Counter.Child messageWrittenCounter(String eventName, int partition); static Counter.Child hearbeatsSentCounter(String eventName, int partition); static Gauge.Child currentRunningOffsetsGauge(String eventName, int partition); static Gauge.Child latestCommittedOffsetGauge(String eventName, int partition); static Gauge.Child latestCommittedTimestampGauge(String eventName, int partition); static void clearCollectors(); static void clearPartitionCollectors(int partition); static Map<Integer, Map<SimpleCollector<?>, Set<List<String>>>> getRegisteredCollectors(); }
PrometheusMetrics { public static void clearPartitionCollectors(int partition) { Map<SimpleCollector<?>, Set<List<String>>> collectorToChildLabels = REGISTERED_COLLECTORS.get(partition); if (collectorToChildLabels != null) { collectorToChildLabels.forEach((collector, childLabels) -> childLabels.forEach(labels -> collector.remove(labels.toArray(new String[0])))); } } private  PrometheusMetrics(); static Counter.Child tmpFileOpenFailuresCounter(String eventName); static Counter.Child tmpFilesOpened(String eventName); static Counter.Child filesCommittedCounter(String eventName); static Counter.Child checkpointFailuresCounter(String eventName, int partition); static Counter.Child checkpointSuccessesCounter(String eventName, int partition); static Counter.Child messageWritingFailuresCounter(String eventName, int partition); static Counter.Child messageWrittenCounter(String eventName, int partition); static Counter.Child hearbeatsSentCounter(String eventName, int partition); static Gauge.Child currentRunningOffsetsGauge(String eventName, int partition); static Gauge.Child latestCommittedOffsetGauge(String eventName, int partition); static Gauge.Child latestCommittedTimestampGauge(String eventName, int partition); static void clearCollectors(); static void clearPartitionCollectors(int partition); static Map<Integer, Map<SimpleCollector<?>, Set<List<String>>>> getRegisteredCollectors();  }