Skip to content

Commit

Permalink
EventQueue metrics are not exported (#945)
Browse files Browse the repository at this point in the history
* Register EventQueue metrics with Coordinator
  • Loading branch information
ehoner authored Jul 12, 2023
1 parent 9f3c26a commit da925e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,9 @@ private void addComponentMetricInfos() {
// CheckpointProvider metrics
addMetricInfos(_coordinator._cpProvider);

// CoordinatorEventBlockingQueue metrics
addMetricInfos(_coordinator._eventQueue);

// EventProducer metrics
_metricInfos.addAll(EventProducer.getMetricInfos());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class CoordinatorEventBlockingQueue implements MetricsAware {

private static final Logger LOG = LoggerFactory.getLogger(CoordinatorEventBlockingQueue.class.getName());
private static final Set<BrooklinMetricInfo> METRIC_INFOS = ConcurrentHashMap.newKeySet();
private final Set<BrooklinMetricInfo> _metricInfos = ConcurrentHashMap.newKeySet();

static final String COUNTER_KEY = "duplicateEvents";
static final String GAUGE_KEY = "queuedEvents";
Expand Down Expand Up @@ -68,7 +68,7 @@ class CoordinatorEventBlockingQueue implements MetricsAware {

BrooklinCounterInfo counterInfo = new BrooklinCounterInfo(MetricRegistry.name(prefix, COUNTER_KEY));
BrooklinGaugeInfo gaugeInfo = new BrooklinGaugeInfo(MetricRegistry.name(prefix, GAUGE_KEY));
METRIC_INFOS.addAll(Arrays.asList(counterInfo, gaugeInfo));
_metricInfos.addAll(Arrays.asList(counterInfo, gaugeInfo));
}


Expand Down Expand Up @@ -161,6 +161,6 @@ public boolean isEmpty() {

@Override
public List<BrooklinMetricInfo> getMetricInfos() {
return new ArrayList<>(METRIC_INFOS);
return new ArrayList<>(_metricInfos);
}
}

0 comments on commit da925e6

Please sign in to comment.