use of lucee.runtime.monitor.Monitor in project Lucee by lucee.
the class Admin method doGetMonitors.
private void doGetMonitors(Query qry, Monitor[] monitors) {
Monitor m;
int row;
for (int i = 0; i < monitors.length; i++) {
m = monitors[i];
row = qry.addRow();
qry.setAtEL(KeyConstants._name, row, m.getName());
qry.setAtEL(KeyConstants._type, row, m.getType() == Monitor.TYPE_INTERVAL ? "intervall" : "request");
qry.setAtEL(LOG_ENABLED, row, m.isLogEnabled());
qry.setAtEL(CLASS, row, m.getClazz().getName());
}
}
use of lucee.runtime.monitor.Monitor in project Lucee by lucee.
the class Admin method doGetMonitor.
private void doGetMonitor() throws PageException {
if (!(config instanceof ConfigServerImpl))
throw new ApplicationException("invalid context for this action");
ConfigServerImpl cs = (ConfigServerImpl) config;
String type = getString("admin", action, "monitorType");
String name = getString("admin", action, "name");
type = type.trim();
Monitor m;
if ("request".equalsIgnoreCase(type))
m = cs.getRequestMonitor(name);
else
m = cs.getIntervallMonitor(name);
Struct sct = new StructImpl();
sct.setEL(KeyConstants._name, m.getName());
sct.setEL(KeyConstants._type, m.getType() == Monitor.TYPE_INTERVAL ? "intervall" : "request");
sct.setEL(LOG_ENABLED, m.isLogEnabled());
sct.setEL(CLASS, m.getClazz().getName());
pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
}
use of lucee.runtime.monitor.Monitor in project Lucee by lucee.
the class XMLConfigAdmin method stopMonitor.
private void stopMonitor(int type, String name) {
Monitor monitor = null;
try {
if (Monitor.TYPE_ACTION == type)
monitor = config.getActionMonitor(name);
else if (Monitor.TYPE_REQUEST == type)
monitor = config.getRequestMonitor(name);
else if (Monitor.TYPE_REQUEST == type)
monitor = config.getIntervallMonitor(name);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
IOUtil.closeEL(monitor);
}
Aggregations