From ded3242a2f65e2171632ff801044ab83b185e7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=84=E9=B8=BF?= Date: Wed, 25 Oct 2023 13:52:11 +0800 Subject: [PATCH] refactor(home): add histogramLogCount --- .../common/util/scope/RequestContext.java | 4 ++++ .../biz/service/log/LogCountResponse.java | 3 +++ .../biz/service/log/LogHistogramCount.java | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogHistogramCount.java diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java index 1063120cf..942ae6cca 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java @@ -47,6 +47,10 @@ public static void setMonitorParams(MonitorParams mp) { gs.get().mp = mp; } + public static void setMonitorScope(MonitorScope ms) { + gs.get().ms = ms; + } + public static class Context { public MonitorScope ms; public MonitorUser mu; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogCountResponse.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogCountResponse.java index 65eb59653..5168f4b54 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogCountResponse.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogCountResponse.java @@ -5,6 +5,8 @@ import lombok.Data; +import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -39,4 +41,5 @@ public class LogCountResponse { * query context */ private Map params; + private List logHistogramCounts = new ArrayList<>(); } diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogHistogramCount.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogHistogramCount.java new file mode 100644 index 000000000..45fe11213 --- /dev/null +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/log/LogHistogramCount.java @@ -0,0 +1,20 @@ +/* + * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. + */ + +package io.holoinsight.server.home.biz.service.log; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author jsy1001de + * @version 1.0: HistogramLogCount.java, Date: 2023-10-25 Time: 10:55 + */ +@Data +@AllArgsConstructor +public class LogHistogramCount { + private Long fromTime; + private Long toTime; + private Long count; +}