REQ-3284: 查询数量过大告警
This commit is contained in:
parent
0e0d7f8d7b
commit
20c664cc38
@ -60,12 +60,12 @@ class ProxyStatement extends StatementWrapper {
|
||||
|
||||
void rowAdvanced() {
|
||||
rowCount++;
|
||||
if (thresholdCrossed() && setWarnedForPhase("Threshold"))
|
||||
if (rowCountAboveThreshold() && setWarnedForPhase("Threshold"))
|
||||
warnFor("Threshold");
|
||||
}
|
||||
|
||||
public void resultSetClosed() {
|
||||
if (thresholdCrossed() && shouldWarnOnResultSetClosed()) {
|
||||
if (rowCountAboveThreshold() && shouldWarnOnResultSetClosed()) {
|
||||
String phase = String.format("ResultSetClose-%d-%d", resultSetWarnTimes, resultSetCount);
|
||||
warnFor(phase);
|
||||
resultSetWarnTimes++;
|
||||
@ -93,7 +93,7 @@ class ProxyStatement extends StatementWrapper {
|
||||
@Override
|
||||
public void close() throws SQLException {
|
||||
super.close();
|
||||
if (thresholdCrossed() && setWarnedForPhase("StatementClose"))
|
||||
if (rowCountAboveThreshold() && setWarnedForPhase("StatementClose"))
|
||||
warnFor("StatementClose");
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class ProxyStatement extends StatementWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean thresholdCrossed() {
|
||||
private boolean rowCountAboveThreshold() {
|
||||
return rowCount > props.getRowCount().determineWarningThreshold();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user