提交 33120d89 authored 作者: Noel Grandin's avatar Noel Grandin

sqlStatement field here can be final

上级 50d1b061
...@@ -62,8 +62,7 @@ public class QueryStatisticsData { ...@@ -62,8 +62,7 @@ public class QueryStatisticsData {
int rowCount) { int rowCount) {
QueryEntry entry = map.get(sqlStatement); QueryEntry entry = map.get(sqlStatement);
if (entry == null) { if (entry == null) {
entry = new QueryEntry(); entry = new QueryEntry(sqlStatement);
entry.sqlStatement = sqlStatement;
map.put(sqlStatement, entry); map.put(sqlStatement, entry);
} }
entry.update(executionTimeNanos, rowCount); entry.update(executionTimeNanos, rowCount);
...@@ -98,7 +97,7 @@ public class QueryStatisticsData { ...@@ -98,7 +97,7 @@ public class QueryStatisticsData {
/** /**
* The SQL statement. * The SQL statement.
*/ */
public String sqlStatement; public final String sqlStatement;
/** /**
* The number of times the statement was executed. * The number of times the statement was executed.
...@@ -158,6 +157,10 @@ public class QueryStatisticsData { ...@@ -158,6 +157,10 @@ public class QueryStatisticsData {
private double executionTimeM2Nanos; private double executionTimeM2Nanos;
private double rowCountM2; private double rowCountM2;
public QueryEntry(String sql) {
this.sqlStatement = sql;
}
/** /**
* Update the statistics entry. * Update the statistics entry.
* *
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论