-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(api): refactor/downgrade record logic for slow log #2347
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,25 +19,36 @@ | |
|
||
public class SlowQueryLog { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
depends on whether to use it for subsequent optimization(could keep it now) |
||
|
||
public Long executeTime; | ||
|
||
public Long startTime; | ||
|
||
public String rawQuery; | ||
|
||
public String method; | ||
|
||
public Long threshold; | ||
|
||
public String path; | ||
|
||
public SlowQueryLog(Long executeTime, Long startTime, String rawQuery, String method, Long threshold, | ||
String path) { | ||
this.executeTime = executeTime; | ||
this.startTime = startTime; | ||
public long executeTime; | ||
|
||
public long startTime; | ||
|
||
public long threshold; | ||
imbajin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
public SlowQueryLog(String rawQuery, String method, String path, | ||
long executeTime, long startTime, long threshold) { | ||
Check warning on line 35 in hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java Codecov / codecov/patchhugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java#L35
|
||
this.rawQuery = rawQuery; | ||
this.method = method; | ||
this.threshold = threshold; | ||
this.path = path; | ||
this.executeTime = executeTime; | ||
this.startTime = startTime; | ||
this.threshold = threshold; | ||
} | ||
Check warning on line 42 in hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java Codecov / codecov/patchhugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java#L39-L42
|
||
|
||
@Override | ||
public String toString() { | ||
return "SlowQueryLog{executeTime=" + executeTime + | ||
Check warning on line 46 in hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java Codecov / codecov/patchhugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/metrics/SlowQueryLog.java#L46
|
||
", startTime=" + startTime + | ||
", rawQuery='" + rawQuery + '\'' + | ||
", method='" + method + '\'' + | ||
", threshold=" + threshold + | ||
imbajin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
", path='" + path + '\'' + | ||
'}'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer
executeTime > timeThreshold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to just update the small change in this PR so that we don’t have to keep track of it.
background
: in order to make it easier to read/understand, prefer to determine whether the executeTime exceeds a threshold.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, already divide it, @SunnyBoy-WYH could address the
background
in next PR