Skip to content

Commit 30f5c23

Browse files
chore: 유저 지표(가입자, 활성 사용자 등) 추가 및 관련 코드 업데이트
1 parent 77300ca commit 30f5c23

2 files changed

Lines changed: 73 additions & 23 deletions

File tree

src/main/java/apu/saerok_admin/infra/stat/StatMetric.java

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,56 @@ public enum StatMetric {
4444
true,
4545
orderedComponentLabels(),
4646
false
47+
),
48+
49+
// ===== 유저 지표 =====
50+
USER_COMPLETED_TOTAL(
51+
"누적 가입자 수",
52+
"현재 가입된 총 사용자 수",
53+
MetricUnit.COUNT,
54+
false,
55+
Map.of(),
56+
true
57+
),
58+
USER_SIGNUP_DAILY(
59+
"일일 가입자 수",
60+
"이 날 신규 가입한 사용자 수",
61+
MetricUnit.COUNT,
62+
false,
63+
Map.of(),
64+
false
65+
),
66+
USER_WITHDRAWAL_DAILY(
67+
"일일 탈퇴자 수",
68+
"이 날 탈퇴한 사용자 수",
69+
MetricUnit.COUNT,
70+
false,
71+
Map.of(),
72+
false
73+
),
74+
USER_DAU(
75+
"DAU",
76+
"일일 활성 사용자 수(그 날 서비스에 몇 명이 접속했는지 기준)",
77+
MetricUnit.COUNT,
78+
false,
79+
Map.of(),
80+
true
81+
),
82+
USER_WAU(
83+
"WAU",
84+
"주간 활성 사용자 수(최근 7일)",
85+
MetricUnit.COUNT,
86+
false,
87+
Map.of(),
88+
false
89+
),
90+
USER_MAU(
91+
"MAU",
92+
"월간 활성 사용자 수(최근 30일)",
93+
MetricUnit.COUNT,
94+
false,
95+
Map.of(),
96+
false
4797
);
4898

4999
private final String label;
@@ -69,29 +119,12 @@ public enum StatMetric {
69119
this.defaultActive = defaultActive;
70120
}
71121

72-
public String label() {
73-
return label;
74-
}
75-
76-
public String description() {
77-
return description;
78-
}
79-
80-
public MetricUnit unit() {
81-
return unit;
82-
}
83-
84-
public boolean multiSeries() {
85-
return multiSeries;
86-
}
87-
88-
public Map<String, String> componentLabels() {
89-
return componentLabels;
90-
}
91-
92-
public boolean defaultActive() {
93-
return defaultActive;
94-
}
122+
public String label() { return label; }
123+
public String description() { return description; }
124+
public MetricUnit unit() { return unit; }
125+
public boolean multiSeries() { return multiSeries; }
126+
public Map<String, String> componentLabels() { return componentLabels; }
127+
public boolean defaultActive() { return defaultActive; }
95128

96129
private static Map<String, String> orderedComponentLabels() {
97130
Map<String, String> labels = new LinkedHashMap<>();

src/main/resources/static/js/service-insight.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@
2222
PENDING_COUNT: 'BIRD_ID_PENDING_COUNT',
2323
RESOLVED_COUNT: 'BIRD_ID_RESOLVED_COUNT',
2424
RESOLUTION_STATS: 'BIRD_ID_RESOLUTION_STATS', // components: min_hours, avg_hours, max_hours, stddev_hours
25+
26+
// ===== 유저 지표 =====
27+
USER_COMPLETED_TOTAL: 'USER_COMPLETED_TOTAL',
28+
USER_SIGNUP_DAILY: 'USER_SIGNUP_DAILY',
29+
USER_WITHDRAWAL_DAILY:'USER_WITHDRAWAL_DAILY',
30+
USER_DAU: 'USER_DAU',
31+
USER_WAU: 'USER_WAU',
32+
USER_MAU: 'USER_MAU',
2533
};
2634

35+
2736
// 컬러 팔레트
2837
const PALETTE = ['#2563eb','#16a34a','#dc2626','#f97316','#9333ea','#0ea5e9','#059669','#ea580c','#3b82f6','#14b8a6'];
2938
const colorCache = new Map();
@@ -231,6 +240,14 @@
231240

232241
const GROUPS = [
233242
{ key: 'privacy', name: '새록', metrics: [METRICS.TOTAL_COUNT, METRICS.PRIVATE_RATIO] },
243+
{ key: 'user', name: '유저', metrics: [
244+
METRICS.USER_COMPLETED_TOTAL,
245+
METRICS.USER_SIGNUP_DAILY,
246+
METRICS.USER_WITHDRAWAL_DAILY,
247+
METRICS.USER_DAU,
248+
METRICS.USER_WAU,
249+
METRICS.USER_MAU
250+
]},
234251
{ key: 'id', name: '동정 요청', metrics: [METRICS.PENDING_COUNT, METRICS.RESOLVED_COUNT, METRICS.RESOLUTION_STATS] },
235252
];
236253
const known = new Set(GROUPS.flatMap(g => g.metrics));

0 commit comments

Comments
 (0)