Skip to content

Commit

Permalink
adding event_queue_depth metric
Browse files Browse the repository at this point in the history
  • Loading branch information
junaidHussain-clari committed Oct 15, 2024
1 parent 29f5a9a commit 7602ccc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ public void refreshEventQueues() {
}
});

Map<String, Map<String, Long>> eventToQueueSize = getQueueSizes();
eventToQueueSize.forEach(
(event, queueMap) -> {
Map.Entry<String, Long> queueSize = queueMap.entrySet().iterator().next();
Monitors.recordEventQueueDepth(queueSize.getKey(), queueSize.getValue());
});

LOGGER.debug("Event queues: {}", eventToQueueMap.keySet());
LOGGER.debug("Stored queue: {}", events);
LOGGER.debug("Removed queue: {}", removed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ public static void recordQueueDepth(String taskType, long size, String ownerApp)
StringUtils.defaultIfBlank(ownerApp, "unknown"));
}

public static void recordEventQueueDepth(String queueType, long size) {
gauge(classQualifier, "event_queue_depth", size, "queueType", queueType);
}

public static void recordTaskInProgress(String taskType, long size, String ownerApp) {
gauge(
classQualifier,
Expand Down

0 comments on commit 7602ccc

Please sign in to comment.