Search in sources :

Example 1 with AtsSystemMonitoringAgent

use of com.axway.ats.agent.components.monitoring.model.agents.AtsSystemMonitoringAgent in project ats-framework by Axway.

the class InternalSystemMonitoringOperations method initializeMonitoring.

@Action(name = "Internal System Monitoring Operations Initialize Monitoring")
public void initializeMonitoring(@Parameter(name = "readings") List<FullReadingBean> readings, @Parameter(name = "startTimestamp") long startTimestamp, @Parameter(name = "pollInterval") int pollInterval) throws Exception {
    monitoringAgent = new AtsSystemMonitoringAgent(startTimestamp, pollInterval);
    Map<String, List<FullReadingBean>> readingsPerMonitor = new HashMap<String, List<FullReadingBean>>();
    // load all the monitors and initialize them
    for (FullReadingBean reading : readings) {
        List<FullReadingBean> readingsForThisMonitor = readingsPerMonitor.get(reading.getMonitorName());
        if (readingsForThisMonitor == null) {
            readingsForThisMonitor = new ArrayList<FullReadingBean>();
            readingsPerMonitor.put(reading.getMonitorName(), readingsForThisMonitor);
        }
        readingsForThisMonitor.add(reading);
    }
    for (String monitorClassName : readingsPerMonitor.keySet()) {
        initializeMonitor(monitorClassName, readingsPerMonitor.get(monitorClassName), pollInterval);
    }
}
Also used : HashMap(java.util.HashMap) List(java.util.List) ArrayList(java.util.ArrayList) FullReadingBean(com.axway.ats.common.performance.monitor.beans.FullReadingBean) AtsSystemMonitoringAgent(com.axway.ats.agent.components.monitoring.model.agents.AtsSystemMonitoringAgent) Action(com.axway.ats.agent.core.model.Action)

Aggregations

AtsSystemMonitoringAgent (com.axway.ats.agent.components.monitoring.model.agents.AtsSystemMonitoringAgent)1 Action (com.axway.ats.agent.core.model.Action)1 FullReadingBean (com.axway.ats.common.performance.monitor.beans.FullReadingBean)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1