400 성공시 성공으로 변경
This commit is contained in:
@@ -22,6 +22,7 @@ public class HourStatsAggregator {
|
|||||||
|
|
||||||
// 건수 메트릭
|
// 건수 메트릭
|
||||||
private final AtomicLong totalCnt = new AtomicLong(0);
|
private final AtomicLong totalCnt = new AtomicLong(0);
|
||||||
|
private final AtomicLong successCnt = new AtomicLong(0);
|
||||||
private final AtomicLong timeoutCnt = new AtomicLong(0);
|
private final AtomicLong timeoutCnt = new AtomicLong(0);
|
||||||
private final AtomicLong systemErrCnt = new AtomicLong(0);
|
private final AtomicLong systemErrCnt = new AtomicLong(0);
|
||||||
private final AtomicLong bizErrCnt = new AtomicLong(0);
|
private final AtomicLong bizErrCnt = new AtomicLong(0);
|
||||||
@@ -67,7 +68,11 @@ public class HourStatsAggregator {
|
|||||||
}
|
}
|
||||||
// 로그 시퀀스 400: 응답시간 및 에러 타입 기록
|
// 로그 시퀀스 400: 응답시간 및 에러 타입 기록
|
||||||
else if (logSeq == 400) {
|
else if (logSeq == 400) {
|
||||||
if (!event.isSuccess()) {
|
// 성공 여부 카운트
|
||||||
|
if (event.isSuccess()) {
|
||||||
|
successCnt.incrementAndGet();
|
||||||
|
} else {
|
||||||
|
// 에러 유형별 카운트
|
||||||
switch (event.getErrorType()) {
|
switch (event.getErrorType()) {
|
||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
timeoutCnt.incrementAndGet();
|
timeoutCnt.incrementAndGet();
|
||||||
@@ -185,11 +190,10 @@ public class HourStatsAggregator {
|
|||||||
|
|
||||||
// 건수 메트릭
|
// 건수 메트릭
|
||||||
long total = totalCnt.get();
|
long total = totalCnt.get();
|
||||||
|
long success = successCnt.get();
|
||||||
long timeout = timeoutCnt.get();
|
long timeout = timeoutCnt.get();
|
||||||
long systemErr = systemErrCnt.get();
|
long systemErr = systemErrCnt.get();
|
||||||
long bizErr = bizErrCnt.get();
|
long bizErr = bizErrCnt.get();
|
||||||
long success = total - (timeout + systemErr + bizErr);
|
|
||||||
success = Math.max(0, success); // 음수 방지
|
|
||||||
|
|
||||||
stats.setTotalCnt(total);
|
stats.setTotalCnt(total);
|
||||||
stats.setSuccessCnt(success);
|
stats.setSuccessCnt(success);
|
||||||
|
|||||||
+7
-3
@@ -22,6 +22,7 @@ public class MinuteStatsAggregator {
|
|||||||
|
|
||||||
// 건수 메트릭
|
// 건수 메트릭
|
||||||
private final AtomicLong totalCnt = new AtomicLong(0);
|
private final AtomicLong totalCnt = new AtomicLong(0);
|
||||||
|
private final AtomicLong successCnt = new AtomicLong(0);
|
||||||
private final AtomicLong timeoutCnt = new AtomicLong(0);
|
private final AtomicLong timeoutCnt = new AtomicLong(0);
|
||||||
private final AtomicLong systemErrCnt = new AtomicLong(0);
|
private final AtomicLong systemErrCnt = new AtomicLong(0);
|
||||||
private final AtomicLong bizErrCnt = new AtomicLong(0);
|
private final AtomicLong bizErrCnt = new AtomicLong(0);
|
||||||
@@ -67,7 +68,11 @@ public class MinuteStatsAggregator {
|
|||||||
}
|
}
|
||||||
// 로그 시퀀스 400: 응답시간 및 에러 타입 기록
|
// 로그 시퀀스 400: 응답시간 및 에러 타입 기록
|
||||||
else if (logSeq == 400) {
|
else if (logSeq == 400) {
|
||||||
if (!event.isSuccess()) {
|
// 성공 여부 카운트
|
||||||
|
if (event.isSuccess()) {
|
||||||
|
successCnt.incrementAndGet();
|
||||||
|
} else {
|
||||||
|
// 에러 유형별 카운트
|
||||||
switch (event.getErrorType()) {
|
switch (event.getErrorType()) {
|
||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
timeoutCnt.incrementAndGet();
|
timeoutCnt.incrementAndGet();
|
||||||
@@ -185,11 +190,10 @@ public class MinuteStatsAggregator {
|
|||||||
|
|
||||||
// 건수 메트릭
|
// 건수 메트릭
|
||||||
long total = totalCnt.get();
|
long total = totalCnt.get();
|
||||||
|
long success = successCnt.get();
|
||||||
long timeout = timeoutCnt.get();
|
long timeout = timeoutCnt.get();
|
||||||
long systemErr = systemErrCnt.get();
|
long systemErr = systemErrCnt.get();
|
||||||
long bizErr = bizErrCnt.get();
|
long bizErr = bizErrCnt.get();
|
||||||
long success = total - (timeout + systemErr + bizErr);
|
|
||||||
success = Math.max(0, success); // 음수 방지
|
|
||||||
|
|
||||||
stats.setTotalCnt(total);
|
stats.setTotalCnt(total);
|
||||||
stats.setSuccessCnt(success);
|
stats.setSuccessCnt(success);
|
||||||
|
|||||||
Reference in New Issue
Block a user