Skip to content

Commit

Permalink
[inner-2390] fix: sqlSlowTime does not take effect
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyh1 committed May 23, 2024
1 parent 563107d commit 99232da
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void setResponseTime(boolean isSuccess, long time, long timeMs) {
schema, sql, sqlType, currentSession.getShardingService().getTxId(), examinedRows, sqlRows,
netOutBytes, resultSize, requestEnd, requestEndMs, new ArrayList<String>(tableList));
StatisticManager.getInstance().push(f);
if (isDetailTrace) {
if (isDetailTrace && getOverAllMilliSecond() > SlowQueryLog.getInstance().getSlowTime()) {
SlowQueryLog.getInstance().putSlowQueryLog(currentSession.getShardingService(), this.clone());
}
if (LOGGER.isDebugEnabled()) {
Expand Down Expand Up @@ -453,6 +453,10 @@ public SqlTraceType getType() {
return this.type;
}

public double getOverAllMilliSecond() {
return (double) (this.requestEnd - this.requestStart) / 1000000000;
}

public String getOverAllSecond() {
double milliSecond = (double) (this.requestEnd - this.requestStart) / 1000000000;
return String.format("%.6f", milliSecond);
Expand Down

0 comments on commit 99232da

Please sign in to comment.