Search in sources :

Example 1 with Monitor

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());
    }
}
Also used : RequestMonitor(lucee.runtime.monitor.RequestMonitor) Monitor(lucee.runtime.monitor.Monitor) IntervallMonitor(lucee.runtime.monitor.IntervallMonitor)

Example 2 with Monitor

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);
}
Also used : ApplicationException(lucee.runtime.exp.ApplicationException) RequestMonitor(lucee.runtime.monitor.RequestMonitor) Monitor(lucee.runtime.monitor.Monitor) IntervallMonitor(lucee.runtime.monitor.IntervallMonitor) StructImpl(lucee.runtime.type.StructImpl) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl) Struct(lucee.runtime.type.Struct)

Example 3 with Monitor

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);
}
Also used : Monitor(lucee.runtime.monitor.Monitor)

Aggregations

Monitor (lucee.runtime.monitor.Monitor)3 IntervallMonitor (lucee.runtime.monitor.IntervallMonitor)2 RequestMonitor (lucee.runtime.monitor.RequestMonitor)2 ConfigServerImpl (lucee.runtime.config.ConfigServerImpl)1 ApplicationException (lucee.runtime.exp.ApplicationException)1 Struct (lucee.runtime.type.Struct)1 StructImpl (lucee.runtime.type.StructImpl)1