blob: a94d006675f45b995e56d87a8e010b88ae195cf8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.clientmetrics;
import com.yahoo.messagebus.Reply;
import com.yahoo.metrics.*;
import com.yahoo.text.XMLWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
/**
* @author thomasg
*/
public class ClientMetrics {
MetricSet topSet;
SumMetric sum;
List<String> routes = new ArrayList<String>();
public ClientMetrics() {
topSet = new SimpleMetricSet("routes", "", "", null);
sum = new SumMetric("total", "", "Messages sent to all routes", topSet);
}
public MetricSet getMetricSet() {
return topSet;
}
public void addRouteMetricSet(RouteMetricSet metric) {
topSet.registerMetric(metric);
sum.addMetricToSum(metric);
routes.add(metric.getRoute());
}
}
|