-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathLatencyMetricsSnapShot.java
More file actions
55 lines (44 loc) · 1.19 KB
/
LatencyMetricsSnapShot.java
File metadata and controls
55 lines (44 loc) · 1.19 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package net.spy.memcached.metrics;
class LatencyMetricsSnapShot {
private static final LatencyMetricsSnapShot EMPTY = new LatencyMetricsSnapShot(0, 0, 0, 0, 0, 0);
private final long avgLatency;
private final long minLatency;
private final long maxLatency;
private final long p25Latency;
private final long p50Latency;
private final long p75Latency;
private final long timestamp; // 캐시 생성 시간
LatencyMetricsSnapShot(long avg, long min, long max, long p25, long p50, long p75) {
this.avgLatency = avg;
this.minLatency = min;
this.maxLatency = max;
this.p25Latency = p25;
this.p50Latency = p50;
this.p75Latency = p75;
this.timestamp = System.currentTimeMillis();
}
public static LatencyMetricsSnapShot empty() {
return EMPTY;
}
public long getAvgLatency() {
return avgLatency;
}
public long getMinLatency() {
return minLatency;
}
public long getMaxLatency() {
return maxLatency;
}
public long getP25Latency() {
return p25Latency;
}
public long getP50Latency() {
return p50Latency;
}
public long getP75Latency() {
return p75Latency;
}
public long getTimestamp() {
return timestamp;
}
}