public static void aggregateOpenGammaClusterSensors(DynamicFabric webFabric) { // at fabric, take the total for ViewProcesses and Reqs/Sec; // and take avg for reqLatency (note: simple avg -- assuming all regions equal) webFabric.addEnricher( CustomAggregatingEnricher.newSummingEnricher( MutableMap.of("allMembers", true), OpenGammaMonitoringAggregation.VIEW_PROCESSES_COUNT, OpenGammaMonitoringAggregation.VIEW_PROCESSES_COUNT, 0, null)); webFabric.addEnricher( CustomAggregatingEnricher.newSummingEnricher( MutableMap.of("allMembers", true), DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW, DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW, null, null)); webFabric.addEnricher( CustomAggregatingEnricher.newSummingEnricher( MutableMap.of("allMembers", true), OpenGammaMonitoringAggregation.OG_SERVER_COUNT, OpenGammaMonitoringAggregation.OG_SERVER_COUNT, null, null)); webFabric.addEnricher( CustomAggregatingEnricher.newAveragingEnricher( MutableMap.of("allMembers", true), HttpLatencyDetector.REQUEST_LATENCY_IN_SECONDS_IN_WINDOW, HttpLatencyDetector.REQUEST_LATENCY_IN_SECONDS_IN_WINDOW, null, null)); }
public static void aggregateOpenGammaServerSensors(Entity cluster) { List<? extends List<? extends AttributeSensor<? extends Number>>> summingEnricherSetup = ImmutableList.of( ImmutableList.of(PROCESSING_TIME_PER_SECOND_LAST, PROCESSING_TIME_PER_SECOND_LAST), ImmutableList.of( PROCESSING_TIME_PER_SECOND_IN_WINDOW, PROCESSING_TIME_PER_SECOND_IN_WINDOW), ImmutableList.of(VIEW_PROCESSES_COUNT, VIEW_PROCESSES_COUNT), ImmutableList.of( PROCESS_CPU_TIME_FRACTION_IN_WINDOW, PROCESS_CPU_TIME_FRACTION_IN_WINDOW)); for (List<? extends AttributeSensor<? extends Number>> es : summingEnricherSetup) { AttributeSensor<? extends Number> t = es.get(0); AttributeSensor<? extends Number> total = es.get(1); CustomAggregatingEnricher<?, ?> totaller = CustomAggregatingEnricher.newSummingEnricher( MutableMap.of("allMembers", true), t, total, null, null); cluster.addEnricher(totaller); } cluster.addEnricher( Enrichers.builder() .aggregating(PROCESSING_TIME_PER_SECOND_LAST) .fromMembers() .publishing(PROCESSING_TIME_PER_SECOND_LAST_PER_NODE) .computingAverage() .defaultValueForUnreportedSensors(null) .build()); cluster.addEnricher( Enrichers.builder() .aggregating(PROCESSING_TIME_PER_SECOND_IN_WINDOW) .fromMembers() .publishing(PROCESSING_TIME_PER_SECOND_IN_WINDOW_PER_NODE) .computingAverage() .defaultValueForUnreportedSensors(null) .build()); cluster.addEnricher( Enrichers.builder() .aggregating(PROCESS_CPU_TIME_FRACTION_IN_WINDOW) .fromMembers() .publishing(PROCESS_CPU_TIME_FRACTION_IN_WINDOW_PER_NODE) .computingAverage() .defaultValueForUnreportedSensors(null) .build()); cluster.addEnricher( Enrichers.builder() .aggregating(VIEW_PROCESSES_COUNT) .fromMembers() .publishing(VIEW_PROCESSES_COUNT_PER_NODE) .computingAverage() .defaultValueForUnreportedSensors(0) .build()); }