Search in sources :

Example 6 with ReadingBean

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

the class AtsJvmMonitor method createReadingInstances.

private void createReadingInstances(ReadingBean[] readings) throws UnsupportedReadingException {
    readingInstances = new ArrayList<JvmReadingInstance>();
    for (ReadingBean reading : readings) {
        String readingName = reading.getName();
        JvmReadingInstance readingInstance = null;
        if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__CPU_USAGE)) {
            readingInstance = getCpuUsage(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__MEMORY_HEAP)) {
            readingInstance = getHeap(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__MEMORY_HEAP_YOUNG_GENERATION_EDEN)) {
            readingInstance = getHeapEden(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__MEMORY_HEAP_YOUNG_GENERATION_SURVIVOR)) {
            readingInstance = getHeapSurvivor(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__MEMORY_HEAP_OLD_GENERATION)) {
            readingInstance = getHeapOldGen(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__MEMORY_PERMANENT_GENERATION)) {
            readingInstance = getHeapPermGen(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__MEMORY_CODE_CACHE)) {
            readingInstance = getHeapCodeCache(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__CLASSES_COUNT)) {
            readingInstance = getClassesCount(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__THREADS_COUNT)) {
            readingInstance = getThreadsCount(connection, reading);
        } else if (readingName.equalsIgnoreCase(SystemMonitorDefinitions.READING_JVM__THREADS_DAEMON_COUNT)) {
            readingInstance = getDaemonThreadsCount(connection, reading);
        } else if (!StringUtils.isNullOrEmpty(reading.getParameter("MBEAN_NAME"))) {
            readingInstance = getCustomMBeanProperty(connection, reading);
        } else {
            throw new UnsupportedReadingException(readingName);
        }
        readingInstances.add(readingInstance);
    }
}
Also used : ReadingBean(com.axway.ats.common.performance.monitor.beans.ReadingBean) UnsupportedReadingException(com.axway.ats.core.monitoring.UnsupportedReadingException)

Example 7 with ReadingBean

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

the class ReadingsRepository method getReadingXmlDefinition.

public final ReadingBean getReadingXmlDefinition(String readingName, Map<String, String> parameters) throws UnsupportedReadingException {
    ReadingBean reading = xmlRepository.getReadingDefinition(readingName);
    reading.setId(getNewUniqueId());
    reading.setParameters(parameters);
    return reading;
}
Also used : ReadingBean(com.axway.ats.common.performance.monitor.beans.ReadingBean)

Example 8 with ReadingBean

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

the class XmlReadingsRepository method addReading.

void addReading(String readingName, ReadingBean reading) {
    if (readings.containsKey(readingName)) {
        ReadingBean alreadyAddedReading = readings.get(readingName);
        log.warn("The reading [" + alreadyAddedReading + "], collected from monitor '" + alreadyAddedReading.getMonitorName() + "' will be replaced with [" + reading + "], collected from monitor '" + reading.getMonitorName() + "'");
    }
    readings.put(readingName, reading);
}
Also used : ReadingBean(com.axway.ats.common.performance.monitor.beans.ReadingBean)

Example 9 with ReadingBean

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

the class AtsSystemMonitor method pollParentProcessInstances.

private List<ReadingBean> pollParentProcessInstances(Collection<ParentProcessReadingBean> parentProcessReadingInstances) {
    List<ReadingBean> redingsResult = new ArrayList<ReadingBean>();
    for (ParentProcessReadingBean readingInstance : parentProcessReadingInstances) {
        // get the collected value from all children
        float value = readingInstance.poll();
        ReadingBean newResult = readingInstance.getNewCopy();
        newResult.setValue(String.valueOf(value));
        redingsResult.add(newResult);
    }
    return redingsResult;
}
Also used : ReadingBean(com.axway.ats.common.performance.monitor.beans.ReadingBean) ParentProcessReadingBean(com.axway.ats.common.performance.monitor.beans.ParentProcessReadingBean) ParentProcessReadingBean(com.axway.ats.common.performance.monitor.beans.ParentProcessReadingBean) ArrayList(java.util.ArrayList)

Example 10 with ReadingBean

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

the class AtsSystemMonitor method pollReadingInstances.

private List<ReadingBean> pollReadingInstances(List<ReadingInstance> readingInstances) throws Exception {
    List<ReadingBean> redingsResult = new ArrayList<ReadingBean>();
    for (ReadingInstance readingInstance : readingInstances) {
        float value = readingInstance.poll();
        ReadingBean newResult = readingInstance.getNewCopy();
        newResult.setValue(String.valueOf(value));
        redingsResult.add(newResult);
    }
    return redingsResult;
}
Also used : ReadingBean(com.axway.ats.common.performance.monitor.beans.ReadingBean) ParentProcessReadingBean(com.axway.ats.common.performance.monitor.beans.ParentProcessReadingBean) ArrayList(java.util.ArrayList)

Aggregations

ReadingBean (com.axway.ats.common.performance.monitor.beans.ReadingBean)30 ArrayList (java.util.ArrayList)10 ParentProcessReadingBean (com.axway.ats.common.performance.monitor.beans.ParentProcessReadingBean)8 MonitoringException (com.axway.ats.core.monitoring.MonitoringException)7 HashSet (java.util.HashSet)7 SessionData (com.axway.ats.agent.webapp.restservice.model.SessionData)6 ErrorPojo (com.axway.ats.agent.webapp.restservice.model.pojo.ErrorPojo)6 MonitorConfigurationException (com.axway.ats.core.monitoring.MonitorConfigurationException)6 Consumes (javax.ws.rs.Consumes)6 POST (javax.ws.rs.POST)6 Path (javax.ws.rs.Path)6 Produces (javax.ws.rs.Produces)6 HashMap (java.util.HashMap)5 UnsupportedReadingException (com.axway.ats.core.monitoring.UnsupportedReadingException)3 Validator (com.axway.ats.core.validation.Validator)3 SystemInformationException (com.axway.ats.agent.core.monitoring.systemmonitor.systeminformation.exceptions.SystemInformationException)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 AtsSystemMonitoringAgent (com.axway.ats.agent.core.monitoring.agents.AtsSystemMonitoringAgent)1 PerformanceMonitor (com.axway.ats.common.performance.monitor.PerformanceMonitor)1