1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.io.hfile;
19
20 import org.apache.hadoop.hbase.util.FastLongHistogram;
21 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
22
23
24
25
26
27 @JsonIgnoreProperties({"ageHistogram", "snapshot"})
28 public class AgeSnapshot {
29
30 private final FastLongHistogram ageHistogram;
31 private final long[] quantiles;
32
33 AgeSnapshot(final FastLongHistogram ageHistogram) {
34 this.ageHistogram = ageHistogram;
35 this.quantiles = ageHistogram.getQuantiles(new double[]{0.75, 0.95, 0.98, 0.99, 0.999});
36 }
37
38 public double get75thPercentile() {
39 return quantiles[0];
40 }
41
42 public double get95thPercentile() {
43 return quantiles[1];
44 }
45
46 public double get98thPercentile() {
47 return quantiles[2];
48 }
49
50 public double get99thPercentile() {
51 return quantiles[3];
52 }
53
54 public double get999thPercentile() {
55 return quantiles[4];
56 }
57
58
59 public double getMean() {
60 return this.ageHistogram.getMean();
61 }
62
63 public double getMax() {
64 return this.ageHistogram.getMax();
65 }
66
67 public double getMin() {
68 return this.ageHistogram.getMin();
69 }
70 }