Search in sources :

Example 6 with BasicReadingBean

use of com.axway.ats.common.performance.monitor.beans.BasicReadingBean in project ats-framework by Axway.

the class AtsSystemMonitor method pollReadingInstances.

private List<BasicReadingBean> pollReadingInstances(List<ReadingInstance> readingInstances) throws Exception {
    List<BasicReadingBean> redingsResult = new ArrayList<BasicReadingBean>();
    for (ReadingInstance readingInstance : readingInstances) {
        float value = readingInstance.poll();
        BasicReadingBean newResult;
        if (readingInstance.isNewInstance()) {
            readingInstance.setNewInstanceFlag(false);
            // the Test Executor needs to be informed about this reading instance
            // we pass back a Full Reading Bean
            newResult = readingInstance.getNewCopy();
        } else {
            // the Test Executor is already aware we are collecting data about this reading instance
            newResult = new BasicReadingBean();
            newResult.setId(readingInstance.getId());
        }
        newResult.setValue(String.valueOf(value));
        redingsResult.add(newResult);
    }
    return redingsResult;
}
Also used : BasicReadingBean(com.axway.ats.common.performance.monitor.beans.BasicReadingBean) ArrayList(java.util.ArrayList)

Example 7 with BasicReadingBean

use of com.axway.ats.common.performance.monitor.beans.BasicReadingBean in project ats-framework by Axway.

the class AtsJvmMonitor method pollReadingInstances.

private List<BasicReadingBean> pollReadingInstances(List<JvmReadingInstance> readingInstances) throws Exception {
    List<BasicReadingBean> redingsResult = new ArrayList<BasicReadingBean>();
    for (JvmReadingInstance readingInstance : readingInstances) {
        float value = readingInstance.poll();
        BasicReadingBean newResult;
        if (readingInstance.isNewInstance()) {
            readingInstance.setNewInstanceFlag(false);
            // the Test Executor needs to be informed about this reading instance
            // we pass back a Full Reading Bean
            newResult = readingInstance.getNewCopy();
        } else {
            // the Test Executor is already aware we are collecting data about this reading instance
            newResult = new BasicReadingBean();
            newResult.setId(readingInstance.getId());
        }
        newResult.setValue(String.valueOf(value));
        redingsResult.add(newResult);
    }
    return redingsResult;
}
Also used : BasicReadingBean(com.axway.ats.common.performance.monitor.beans.BasicReadingBean) ArrayList(java.util.ArrayList)

Aggregations

BasicReadingBean (com.axway.ats.common.performance.monitor.beans.BasicReadingBean)7 ArrayList (java.util.ArrayList)4 ParentProcessReadingBean (com.axway.ats.common.performance.monitor.beans.ParentProcessReadingBean)3 FullReadingBean (com.axway.ats.common.performance.monitor.beans.FullReadingBean)1 MonitorResults (com.axway.ats.common.performance.monitor.beans.MonitorResults)1 DbAccessFactory (com.axway.ats.log.autodb.DbAccessFactory)1 ReadingsRepository (com.axway.ats.monitoring.model.readings.ReadingsRepository)1 HashMap (java.util.HashMap)1 Logger (org.apache.log4j.Logger)1