Search in sources :

Example 1 with MonitorRepository

use of com.creditease.monitor.captureframework.spi.MonitorRepository in project uavstack by uavorg.

the class StandardMonitor method doPreStore.

@Override
public void doPreStore() {
    MonitorRepository cmr = getRepository();
    MonitorElement[] elems = cmr.getElements();
    for (MonitorElement elem : elems) {
        MonitorElemCapHandler caphandler = selectHandler(elem.getCapClass());
        if (caphandler == null)
            continue;
        MonitorElementInstance[] instances = elem.getInstances();
        for (MonitorElementInstance instance : instances) {
            try {
                caphandler.preStore(instance);
            } catch (Exception e) {
                log.error("captureHandler[" + caphandler.getClass().getName() + "] execution [preStore] fails ", e);
            // ignore
            }
        }
    }
}
Also used : MonitorElementInstance(com.creditease.monitor.captureframework.spi.MonitorElementInstance) MonitorRepository(com.creditease.monitor.captureframework.spi.MonitorRepository) StandardMonitorRepository(com.creditease.monitor.captureframework.repository.StandardMonitorRepository) MonitorElemCapHandler(com.creditease.monitor.captureframework.spi.MonitorElemCapHandler) MonitorElement(com.creditease.monitor.captureframework.spi.MonitorElement)

Aggregations

StandardMonitorRepository (com.creditease.monitor.captureframework.repository.StandardMonitorRepository)1 MonitorElemCapHandler (com.creditease.monitor.captureframework.spi.MonitorElemCapHandler)1 MonitorElement (com.creditease.monitor.captureframework.spi.MonitorElement)1 MonitorElementInstance (com.creditease.monitor.captureframework.spi.MonitorElementInstance)1 MonitorRepository (com.creditease.monitor.captureframework.spi.MonitorRepository)1