feat(api): support recording slow query log#2327
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2327 +/- ##
============================================
+ Coverage 63.85% 66.28% +2.43%
- Complexity 684 981 +297
============================================
Files 505 507 +2
Lines 41902 42084 +182
Branches 5817 5832 +15
============================================
+ Hits 26756 27897 +1141
+ Misses 12455 11475 -980
- Partials 2691 2712 +21
... and 111 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java
Show resolved
Hide resolved
hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java
Outdated
Show resolved
Hide resolved
javeme
left a comment
There was a problem hiding this comment.
please rebase latest master code
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java
Outdated
Show resolved
Hide resolved
# Conflicts: # hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java
| .update(responseTime); | ||
|
|
||
| HugeConfig config = configProvider.get(); | ||
| Long timeThreshold = config.get(ServerOptions.SLOW_QUERY_LOG_TIME_THRESHOLD); |
There was a problem hiding this comment.
Holding the timeThreshold in a private variable and changing its type to long would be better, reducing the cost of unboxing and hash searching.
There was a problem hiding this comment.
thanks , but i dont know “Holding the timeThreshold in a private variable ” means what? thanks again
There was a problem hiding this comment.
Just like this:
public class AccessLogFilter implements ContainerResponseFilter {
private long timeThreshold =configProvider.get().get(ServerOptions.SLOW_QUERY_LOG_TIME_THRESHOLD);
.....
}
Of course, you need to check for null.
There was a problem hiding this comment.
Just like this:
public class AccessLogFilter implements ContainerResponseFilter { private long timeThreshold =configProvider.get().get(ServerOptions.SLOW_QUERY_LOG_TIME_THRESHOLD); ..... }Of course, you need to check for null.
we cant get timeThreshold as private var from configProvider, because configProvider managed by @context; it will case NPE.
hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java
Show resolved
Hide resolved
|
Could also add some basic introduction for the record in doc |
* chore(api): code style for cr --------- Co-authored-by: imbajin <[email protected]>
* chore(api): code style for cr --------- Co-authored-by: imbajin <[email protected]>
Purpose of the PR
subtask of #2325
Main Changes
Verifying these changes
we can run test , and we can see:
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO