use of doitincloud.rdbcache.models.Monitor in project rdbcache by rdbcache.
the class Context method enableMonitor.
public void enableMonitor(String name, String type, String action) {
monitorEnabled = true;
if (monitor == null) {
monitor = new Monitor(name, type, action);
} else {
monitor.setName(name);
monitor.setTypeAndAction(type, action);
}
monitor.setTraceId(traceId);
}
use of doitincloud.rdbcache.models.Monitor in project rdbcache by rdbcache.
the class Context method enableMonitor.
public void enableMonitor(HttpServletRequest request) {
monitorEnabled = true;
if (monitor == null) {
monitor = new Monitor(request.getRequestURI(), "http", action);
} else {
monitor.setName(request.getRequestURI());
monitor.setTypeAndAction("http", action);
}
monitor.setTraceId(traceId);
}
use of doitincloud.rdbcache.models.Monitor in project rdbcache by rdbcache.
the class MonitorRepoImpl method findById.
@Override
public Monitor findById(Long id) {
String sql = "select * from " + monitorTable + " where id = ?";
Object[] params = new Object[] { id };
Monitor monitor = jdbcTemplate.queryForObject(sql, params, Monitor.class);
if (monitor == null) {
return null;
}
sql = "select * from " + stopWatchTable + " where monitor_id = ?";
List<StopWatch> list = jdbcTemplate.queryForList(sql, params, StopWatch.class);
monitor.setStopWatches(list);
return monitor;
}