use of com.axway.ats.agent.core.monitoring.agents.AtsSystemMonitoringAgent in project ats-framework by Axway.
the class AgentSystemMonitor method initializeMonitoring.
public void initializeMonitoring(List<ReadingBean> readings, int pollInterval, long executorTimeOffset) {
monitoringAgent = new AtsSystemMonitoringAgent(pollInterval, executorTimeOffset);
if (pollInterval < 1) {
throw new MonitoringException("The interval for collecting statistical data must be at least 1 second. You have specified " + pollInterval + " seconds");
}
Map<String, List<ReadingBean>> readingsPerMonitor = new HashMap<String, List<ReadingBean>>();
// load all the monitors and initialize them
for (ReadingBean reading : readings) {
List<ReadingBean> readingsForThisMonitor = readingsPerMonitor.get(reading.getMonitorName());
if (readingsForThisMonitor == null) {
readingsForThisMonitor = new ArrayList<ReadingBean>();
readingsPerMonitor.put(reading.getMonitorName(), readingsForThisMonitor);
}
readingsForThisMonitor.add(reading);
}
for (String monitorClassName : readingsPerMonitor.keySet()) {
initializeMonitor(monitorClassName, readingsPerMonitor.get(monitorClassName), pollInterval);
}
}
Aggregations