Skip to content

Commit

Permalink
Fix command type name
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Feb 17, 2025
1 parent 8d783f9 commit 41d29a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public void recordCommandLatency(SocketAddress local, SocketAddress remote, Prot
CommandLatencyId commandLatencyId = CommandLatencyId.create(local, remote, protocolKeyword);

Timer firstResponseTimer = firstResponseTimers.computeIfAbsent(commandLatencyId, c -> metricRegistry
.timer(name(METRIC_FIRST_RESPONSE, c.commandType().name())));
.timer(name(METRIC_FIRST_RESPONSE, c.commandType().toString())));
firstResponseTimer.update(firstResponseLatency, TimeUnit.NANOSECONDS);

Timer completionTimer = completionTimers.computeIfAbsent(commandLatencyId, c -> metricRegistry
.timer(name(METRIC_COMPLETION, c.commandType().name())));
.timer(name(METRIC_COMPLETION, c.commandType().toString())));
completionTimer.update(completionLatency, TimeUnit.NANOSECONDS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public CommandLatencyEventVisitor(final String name, final MetricRegistry metric
@Override
public void visit(final CommandLatencyEvent event) {
event.getLatencies().forEach((commandLatencyId, commandMetrics) -> {
final String commandType = commandLatencyId.commandType().name();
final String commandType = commandLatencyId.commandType().toString();
final String metricName = metricNames.computeIfAbsent(commandType, (type) -> MetricRegistry.name(name, type));
metrics.timer(metricName).update(commandMetrics.getCompletion().getMax(), commandMetrics.getTimeUnit());
});
Expand Down

0 comments on commit 41d29a6

Please sign in to comment.