1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.metrics2.lib;
20
21 import org.apache.hadoop.hbase.classification.InterfaceAudience;
22 import org.apache.hadoop.metrics2.MetricsInfo;
23
24
25
26
27 @InterfaceAudience.Private
28 public class MutableTimeHistogram extends MutableRangeHistogram {
29 private final static String RANGE_TYPE = "TimeRangeCount";
30 private final static long[] RANGES =
31 { 1, 3, 10, 30, 100, 300, 1000, 3000, 10000, 30000, 60000, 120000, 300000, 600000 };
32
33 public MutableTimeHistogram(MetricsInfo info) {
34 this(info.name(), info.description());
35 }
36
37 public MutableTimeHistogram(String name, String description) {
38 this(name, description, RANGES[RANGES.length - 2]);
39 }
40
41 public MutableTimeHistogram(String name, String description, long expectedMax) {
42 super(name, description, expectedMax);
43 }
44
45 @Override
46 public String getRangeType() {
47 return RANGE_TYPE;
48 }
49
50 @Override
51 public long[] getRanges() {
52 return RANGES;
53 }
54
55 }