ComponentMetricSummary { @VisibleForTesting static double aggregateProcessLatency(TopologyTimeSeriesMetrics.TimeSeriesComponentMetric metrics) { return calculateWeightedAverage(metrics.getProcessedTime(), metrics.getInputRecords()); } ComponentMetricSummary(Long emitted, Long acked, Long failed, Double latency, Double completeLatency,
                                  Double processTime, Double executeTime,
                                  Long prevEmitted, Long prevAcked, Long prevFailed, Double prevLatency,
                                  Double prevCompleteLatency, Double prevProcessTime, Double prevExecuteTime); Long getEmitted(); Long getAcked(); Long getFailed(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getLatency(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getCompleteLatency(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getProcessTime(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getExecuteTime(); Long getPrevEmitted(); Long getPrevAcked(); Long getPrevFailed(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getPrevLatency(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getPrevCompleteLatency(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getPrevProcessTime(); @JsonInclude(JsonInclude.Include.NON_NULL) Double getPrevExecuteTime(); static ComponentMetricSummary convertTopologyMetric(TopologyTimeSeriesMetrics.TimeSeriesComponentMetric metrics,
                                                               TopologyTimeSeriesMetrics.TimeSeriesComponentMetric prevMetrics); static ComponentMetricSummary convertSourceMetric(TopologyTimeSeriesMetrics.TimeSeriesComponentMetric metrics,
                                                             TopologyTimeSeriesMetrics.TimeSeriesComponentMetric prevMetrics); static ComponentMetricSummary convertNonSourceMetric(TopologyTimeSeriesMetrics.TimeSeriesComponentMetric metrics,
                                                                TopologyTimeSeriesMetrics.TimeSeriesComponentMetric prevMetrics);  }
@Test public void testAggregateProcessLatency() { TopologyTimeSeriesMetrics.TimeSeriesComponentMetric metric = getTestMetric(); double actual = ComponentMetricSummary.aggregateProcessLatency(metric); double expected = 3.456d; Assert.assertEquals(expected, actual, DoubleUtils.EPSILON); }