diff --git a/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java b/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java index c4ef047146..b1a4d08d10 100644 --- a/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java +++ b/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java @@ -94,7 +94,7 @@ public void filter(ContainerRequestContext requestContext, ContainerResponseCont // record slow query log if (enableSlowQueryLog && isSlowQueryLogWhiteAPI(requestContext) && timeThreshold < responseTime) { - SlowQueryLog log = new SlowQueryLog(responseTime, + SlowQueryLog log = new SlowQueryLog(responseTime, (Long) requestTime, (String) requestContext.getProperty(REQUEST_PARAMS_JSON), method, timeThreshold, path); LOG.info("slow query log: {}", JsonUtil.toJson(log)); } diff --git a/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java b/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java index 70d708864b..947b5ecc8e 100644 --- a/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java +++ b/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java @@ -21,6 +21,8 @@ public class SlowQueryLog { public Long executeTime; + public Long startTime; + public String rawQuery; public String method; @@ -29,7 +31,9 @@ public class SlowQueryLog { public String path; - public SlowQueryLog(Long executeTime, String rawQuery, String method, Long threshold, + + + public SlowQueryLog(Long executeTime, Long startTime, String rawQuery, String method, Long threshold, String path) { this.executeTime = executeTime; this.rawQuery = rawQuery;