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);
}
}
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;
}
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);
}
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;
}
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;
}
Aggregations