Skip to content

Commit

Permalink
KAFKA-1251 Missed one per-node metric.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkreps committed Mar 28, 2014
1 parent 23d7fc4 commit e287e02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -867,14 +867,16 @@ public void recordErrors(String topic, int count) {

public void recordLatency(int node, long latency, long nowNs) {
this.requestTimeSensor.record(latency, nowNs);
String nodeTimeName = "server." + node + ".latency";
Sensor nodeRequestTime = this.metrics.getSensor(nodeTimeName);
if (nodeRequestTime == null) {
nodeRequestTime = this.metrics.sensor(nodeTimeName);
nodeRequestTime.add("node-" + node + ".latency-avg", new Avg());
nodeRequestTime.add("node-" + node + ".latency-max", new Max());
if (node >= 0) {
String nodeTimeName = "server." + node + ".latency";
Sensor nodeRequestTime = this.metrics.getSensor(nodeTimeName);
if (nodeRequestTime == null) {
nodeRequestTime = this.metrics.sensor(nodeTimeName);
nodeRequestTime.add("node-" + node + ".latency-avg", new Avg());
nodeRequestTime.add("node-" + node + ".latency-max", new Max());
}
nodeRequestTime.record(latency, nowNs);
}
nodeRequestTime.record(latency, nowNs);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void recordBytesSent(int node, int bytes) {
sensor.add("node-" + node + ".requests-sent-per-second",
"The average number of requests sent per second.",
new Rate(new Count()));
sensor.add("connection-" + node + ".request-size-avg", "The average size of all requests in the window..", new Avg());
sensor.add("node-" + node + ".request-size-avg", "The average size of all requests in the window..", new Avg());
sensor.add("node-" + node + ".request-size-max", "The maximum size of any request sent in the window.", new Max());
}
sensor.record(bytes);
Expand Down

0 comments on commit e287e02

Please sign in to comment.