Search in sources :

Example 1 with Monitor

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);
}
Also used : Monitor(doitincloud.rdbcache.models.Monitor)

Example 2 with Monitor

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);
}
Also used : Monitor(doitincloud.rdbcache.models.Monitor)

Example 3 with Monitor

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;
}
Also used : Monitor(doitincloud.rdbcache.models.Monitor) StopWatch(doitincloud.rdbcache.models.StopWatch)

Aggregations

Monitor (doitincloud.rdbcache.models.Monitor)3 StopWatch (doitincloud.rdbcache.models.StopWatch)1