improve sql-wall

This commit is contained in:
wenshao
2013-08-25 23:36:18 +08:00
parent e10c681671
commit b05671447c
25 changed files with 497 additions and 53 deletions
@@ -38,6 +38,9 @@ public class WallSqlStatValue {
@MField(aggregate = AggregateType.Sum)
private long executeCount;
@MField(aggregate = AggregateType.Sum)
private long executeErrorCount;
@MField(aggregate = AggregateType.Sum)
private long fetchRowCount;
@@ -118,6 +121,14 @@ public class WallSqlStatValue {
this.violationMessage = violationMessage;
}
public long getExecuteErrorCount() {
return executeErrorCount;
}
public void setExecuteErrorCount(long executeErrorCount) {
this.executeErrorCount = executeErrorCount;
}
public Map<String, Object> toMap() {
Map<String, Object> sqlStatMap = new LinkedHashMap<String, Object>();
sqlStatMap.put("sql", sql);
@@ -125,6 +136,10 @@ public class WallSqlStatValue {
sqlStatMap.put("sample", sqlSample);
}
sqlStatMap.put("executeCount", getExecuteCount());
if (executeErrorCount > 0) {
sqlStatMap.put("executeErrorCount", executeErrorCount);
}
if (fetchRowCount > 0) {
sqlStatMap.put("fetchRowCount", fetchRowCount);