StatisticsType type = ds.findType("CachePerfStats"); if (type != null) { Statistics[] statistics = ds.findStatisticsByType(type); if (statistics != null && statistics.length > 0) { cachePerfStats = statistics[0]; StatisticsType type = ds.findType("VMStats"); if (type != null) { Statistics[] statistics = ds.findStatisticsByType(type); if (statistics != null && statistics.length > 0) { vmStats = statistics[0];
@Test public void delegatesFindStatisticsByTypeToStatisticsManager() { Statistics[] statisticsReturnedByManager = {}; when(statisticsManager.findStatisticsByType(STATISTICS_TYPE)) .thenReturn(statisticsReturnedByManager); Statistics[] result = internalDistributedSystem .findStatisticsByType(STATISTICS_TYPE); assertThat(result) .isSameAs(statisticsReturnedByManager); }
public void addVMStats() { VMStatsContract vmStatsContract = system.getStatSampler().getVMStats(); if (vmStatsContract != null && vmStatsContract instanceof VMStats50) { VMStats50 vmStats50 = (VMStats50) vmStatsContract; Statistics vmStats = vmStats50.getVMStats(); if (vmStats != null) { vmStatsMonitor.addStatisticsToMonitor(vmStats); } Statistics vmHeapStats = vmStats50.getVMHeapStats(); if (vmHeapStats != null) { vmStatsMonitor.addStatisticsToMonitor(vmHeapStats); } StatisticsType gcType = VMStats50.getGCType(); if (gcType != null) { Statistics[] gcStats = system.findStatisticsByType(gcType); if (gcStats != null && gcStats.length > 0) { for (Statistics gcStat : gcStats) { if (gcStat != null) { gcMonitor.addStatisticsToMonitor(gcStat); } } } } } }
systemStats = system.findStatisticsByType(SolarisSystemStats.getType()); } else if (HostStatHelper.isLinux()) { systemStats = system.findStatisticsByType(LinuxSystemStats.getType()); } else if (HostStatHelper.isOSX()) { systemStats = system.findStatisticsByType(WindowsSystemStats.getType());