-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatMetric.java
More file actions
143 lines (135 loc) · 4.01 KB
/
Copy pathStatMetric.java
File metadata and controls
143 lines (135 loc) · 4.01 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package apu.saerok_admin.infra.stat;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
public enum StatMetric {
COLLECTION_TOTAL_COUNT(
"새록 총 개수",
"등록된 새록의 총 개수",
MetricUnit.COUNT,
false,
Map.of(),
true
),
COLLECTION_PRIVATE_RATIO(
"비공개 새록 비율",
"전체 새록 중 비공개로 설정된 비율",
MetricUnit.RATIO,
false,
Map.of(),
false
),
BIRD_ID_PENDING_COUNT(
"진행 중인 동정 요청 개수",
"이 날 진행 중인 동정 요청의 개수\n(= \"이름 모를 새 새록\"의 개수)",
MetricUnit.COUNT,
false,
Map.of(),
false
),
BIRD_ID_RESOLVED_COUNT(
"동정 의견 채택 횟수",
"이 날 동정 의견이 몇 번 채택됐는지 횟수",
MetricUnit.COUNT,
false,
Map.of(),
true
),
BIRD_ID_RESOLUTION_STATS(
"동정 의견 채택 시간",
"동정 요청 후 채택되기까지 평균적으로 걸린 시간",
MetricUnit.HOURS,
true,
orderedComponentLabels(),
false
),
// ===== 유저 지표 =====
USER_COMPLETED_TOTAL(
"누적 가입자 수",
"현재 가입된 총 사용자 수",
MetricUnit.COUNT,
false,
Map.of(),
true
),
USER_SIGNUP_DAILY(
"일일 가입자 수",
"이 날 신규 가입한 사용자 수",
MetricUnit.COUNT,
false,
Map.of(),
false
),
USER_WITHDRAWAL_DAILY(
"일일 탈퇴자 수",
"이 날 탈퇴한 사용자 수",
MetricUnit.COUNT,
false,
Map.of(),
false
),
USER_DAU(
"DAU",
"일일 활성 사용자 수(그 날 서비스에 몇 명이 접속했는지 기준)",
MetricUnit.COUNT,
false,
Map.of(),
true
),
USER_WAU(
"WAU",
"주간 활성 사용자 수(최근 7일)",
MetricUnit.COUNT,
false,
Map.of(),
false
),
USER_MAU(
"MAU",
"월간 활성 사용자 수(최근 30일)",
MetricUnit.COUNT,
false,
Map.of(),
false
);
private final String label;
private final String description;
private final MetricUnit unit;
private final boolean multiSeries;
private final Map<String, String> componentLabels;
private final boolean defaultActive;
StatMetric(
String label,
String description,
MetricUnit unit,
boolean multiSeries,
Map<String, String> componentLabels,
boolean defaultActive
) {
this.label = label;
this.description = description;
this.unit = unit;
this.multiSeries = multiSeries;
this.componentLabels = componentLabels;
this.defaultActive = defaultActive;
}
public String label() { return label; }
public String description() { return description; }
public MetricUnit unit() { return unit; }
public boolean multiSeries() { return multiSeries; }
public Map<String, String> componentLabels() { return componentLabels; }
public boolean defaultActive() { return defaultActive; }
private static Map<String, String> orderedComponentLabels() {
Map<String, String> labels = new LinkedHashMap<>();
labels.put("min_hours", "최소");
labels.put("max_hours", "최대");
labels.put("avg_hours", "평균");
labels.put("stddev_hours", "표준편차");
return Collections.unmodifiableMap(labels);
}
public enum MetricUnit {
COUNT,
RATIO,
HOURS
}
}