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.codehaus.jackson.annotate.JsonIgnoreProperties;
21
22 import com.yammer.metrics.core.Histogram;
23 import com.yammer.metrics.stats.Snapshot;
24
25
26
27
28
29 @JsonIgnoreProperties({"ageHistogram", "snapshot"})
30 public class AgeSnapshot {
31 private final Histogram ageHistogram;
32 private final Snapshot snapshot;
33
34 AgeSnapshot(final Histogram ageHistogram) {
35 this.ageHistogram = ageHistogram;
36 this.snapshot = ageHistogram.getSnapshot();
37 }
38
39 public double get75thPercentile() {
40 return snapshot.get75thPercentile();
41 }
42
43 public double get95thPercentile() {
44 return snapshot.get95thPercentile();
45 }
46
47 public double get98thPercentile() {
48 return snapshot.get98thPercentile();
49 }
50
51 public double get999thPercentile() {
52 return snapshot.get999thPercentile();
53 }
54
55 public double get99thPercentile() {
56 return snapshot.get99thPercentile();
57 }
58
59 public double getMean() {
60 return this.ageHistogram.mean();
61 }
62
63 public double getMax() {
64 return ageHistogram.max();
65 }
66
67 public double getMin() {
68 return ageHistogram.min();
69 }
70
71 public double getStdDev() {
72 return ageHistogram.stdDev();
73 }
74 }