Skip to content

Commit

Permalink
Added total committed metric and fixed tests
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Kondaka <[email protected]>
  • Loading branch information
Krishna Kondaka committed Aug 8, 2023
1 parent 6e91aac commit f4a727d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void setup() {
when(jsonTopic.getName()).thenReturn(testTopic);
when(jsonTopic.getGroupId()).thenReturn(testGroup);
when(jsonTopic.getWorkers()).thenReturn(1);
when(jsonTopic.getMaxPollInterval()).thenReturn(Duration.ofSeconds(5));
when(jsonTopic.getSessionTimeOut()).thenReturn(Duration.ofSeconds(15));
when(jsonTopic.getHeartBeatInterval()).thenReturn(Duration.ofSeconds(3));
when(jsonTopic.getAutoCommit()).thenReturn(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public void setup() {
when(plainTextTopic.getName()).thenReturn(testTopic);
when(plainTextTopic.getGroupId()).thenReturn(testGroup);
when(plainTextTopic.getWorkers()).thenReturn(1);
when(plainTextTopic.getMaxPollInterval()).thenReturn(Duration.ofSeconds(5));
when(plainTextTopic.getSessionTimeOut()).thenReturn(Duration.ofSeconds(15));
when(plainTextTopic.getHeartBeatInterval()).thenReturn(Duration.ofSeconds(3));
when(plainTextTopic.getAutoCommit()).thenReturn(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public KafkaTopicMetrics(final String topicName, final PluginMetrics pluginMetri
camelCaseMap.put("records-lag-max", "recordsLagMax");
camelCaseMap.put("records-lead-min", "recordsLeadMin");
camelCaseMap.put("commit-rate", "commitRate");
camelCaseMap.put("commit-total", "commitTotal");
camelCaseMap.put("join-rate", "joinRate");
camelCaseMap.put("incoming-byte-rate", "incomingByteRate");
camelCaseMap.put("outgoing-byte-rate", "outgoingByteRate");
Expand Down Expand Up @@ -81,7 +82,7 @@ public void update(final KafkaConsumer consumer) {
if ((metricName.contains("consumed")) ||
((!metric.tags().containsKey("partition")) &&
(metricName.equals("records-lag-max") || metricName.equals("records-lead-min"))) ||
(metricName.equals("commit-rate") || metricName.equals("join-rate")) ||
(metricName.equals("commit-rate") || metricName.equals("join-rate") || metricName.equals("commit-total")) ||
(metricName.equals("incoming-byte-rate") || metricName.equals("outgoing-byte-rate"))) {
cmetrics.put(metricName, value.metricValue());
}
Expand Down

0 comments on commit f4a727d

Please sign in to comment.