use of com.actiontech.dble.statistic.stat.SqlResultSizeRecorder in project dble by actiontech.
the class DbleServer method resultSetMapClear.
/**
* clean up the data in UserStatAnalyzer
*/
private Runnable resultSetMapClear() {
return new Runnable() {
@Override
public void run() {
try {
BufferPool pool = getBufferPool();
long bufferSize = pool.size();
long bufferCapacity = pool.capacity();
long bufferUsagePercent = (bufferCapacity - bufferSize) * 100 / bufferCapacity;
if (bufferUsagePercent < DbleServer.getInstance().getConfig().getSystem().getBufferUsagePercent()) {
Map<String, UserStat> map = UserStatAnalyzer.getInstance().getUserStatMap();
Set<String> userSet = DbleServer.getInstance().getConfig().getUsers().keySet();
for (String user : userSet) {
UserStat userStat = map.get(user);
if (userStat != null) {
SqlResultSizeRecorder recorder = userStat.getSqlResultSizeRecorder();
recorder.clearSqlResultSet();
}
}
}
} catch (Exception e) {
LOGGER.info("resultSetMapClear err " + e);
}
}
};
}
Aggregations