@Test public void testPublish() { MyClock clock = new MyClock(10L, delta); EnvironmentEdgeManager.injectEdge(clock); overAllQueryMetrics.startQuery(); overAllQueryMetrics.startResultSetWatch(); assertPublishedMetrics(overAllQueryMetrics.publish(), numParallelScans, queryTimeouts, queryFailures, cacheRefreshesDueToSplits, 0L); overAllQueryMetrics.endQuery(); overAllQueryMetrics.stopResultSetWatch(); assertPublishedMetrics(overAllQueryMetrics.publish(), numParallelScans, queryTimeouts, queryFailures, cacheRefreshesDueToSplits, 2*delta); }
public Map<MetricType, Long> publish() { Map<MetricType, Long> metricsForPublish = new HashMap<>(); metricsForPublish.put(numParallelScans.getMetricType(), numParallelScans.getValue()); metricsForPublish.put(wallClockTimeMS.getMetricType(), wallClockTimeMS.getValue()); metricsForPublish.put(resultSetTimeMS.getMetricType(), resultSetTimeMS.getValue()); metricsForPublish.put(queryTimedOut.getMetricType(), queryTimedOut.getValue()); metricsForPublish.put(queryFailed.getMetricType(), queryFailed.getValue()); metricsForPublish.put(cacheRefreshedDueToSplits.getMetricType(), cacheRefreshedDueToSplits.getValue()); return metricsForPublish; }
OverAllQueryMetrics { public Map<MetricType, Long> publish() { Map<MetricType, Long> metricsForPublish = new HashMap<>(); metricsForPublish.put(numParallelScans.getMetricType(), numParallelScans.getValue()); metricsForPublish.put(wallClockTimeMS.getMetricType(), wallClockTimeMS.getValue()); metricsForPublish.put(resultSetTimeMS.getMetricType(), resultSetTimeMS.getValue()); metricsForPublish.put(queryTimedOut.getMetricType(), queryTimedOut.getValue()); metricsForPublish.put(queryFailed.getMetricType(), queryFailed.getValue()); metricsForPublish.put(cacheRefreshedDueToSplits.getMetricType(), cacheRefreshedDueToSplits.getValue()); return metricsForPublish; } }
OverAllQueryMetrics { public Map<MetricType, Long> publish() { Map<MetricType, Long> metricsForPublish = new HashMap<>(); metricsForPublish.put(numParallelScans.getMetricType(), numParallelScans.getValue()); metricsForPublish.put(wallClockTimeMS.getMetricType(), wallClockTimeMS.getValue()); metricsForPublish.put(resultSetTimeMS.getMetricType(), resultSetTimeMS.getValue()); metricsForPublish.put(queryTimedOut.getMetricType(), queryTimedOut.getValue()); metricsForPublish.put(queryFailed.getMetricType(), queryFailed.getValue()); metricsForPublish.put(cacheRefreshedDueToSplits.getMetricType(), cacheRefreshedDueToSplits.getValue()); return metricsForPublish; } OverAllQueryMetrics(boolean isRequestMetricsEnabled, LogLevel connectionLogLevel); }
OverAllQueryMetrics { public Map<MetricType, Long> publish() { Map<MetricType, Long> metricsForPublish = new HashMap<>(); metricsForPublish.put(numParallelScans.getMetricType(), numParallelScans.getValue()); metricsForPublish.put(wallClockTimeMS.getMetricType(), wallClockTimeMS.getValue()); metricsForPublish.put(resultSetTimeMS.getMetricType(), resultSetTimeMS.getValue()); metricsForPublish.put(queryTimedOut.getMetricType(), queryTimedOut.getValue()); metricsForPublish.put(queryFailed.getMetricType(), queryFailed.getValue()); metricsForPublish.put(cacheRefreshedDueToSplits.getMetricType(), cacheRefreshedDueToSplits.getValue()); return metricsForPublish; } OverAllQueryMetrics(boolean isRequestMetricsEnabled, LogLevel connectionLogLevel); void updateNumParallelScans(long numParallelScans); void queryTimedOut(); void queryFailed(); void cacheRefreshedDueToSplits(); void startQuery(); void endQuery(); void startResultSetWatch(); void stopResultSetWatch(); Map<MetricType, Long> publish(); void reset(); OverAllQueryMetrics combine(OverAllQueryMetrics metric); }
OverAllQueryMetrics { public Map<MetricType, Long> publish() { Map<MetricType, Long> metricsForPublish = new HashMap<>(); metricsForPublish.put(numParallelScans.getMetricType(), numParallelScans.getValue()); metricsForPublish.put(wallClockTimeMS.getMetricType(), wallClockTimeMS.getValue()); metricsForPublish.put(resultSetTimeMS.getMetricType(), resultSetTimeMS.getValue()); metricsForPublish.put(queryTimedOut.getMetricType(), queryTimedOut.getValue()); metricsForPublish.put(queryFailed.getMetricType(), queryFailed.getValue()); metricsForPublish.put(cacheRefreshedDueToSplits.getMetricType(), cacheRefreshedDueToSplits.getValue()); return metricsForPublish; } OverAllQueryMetrics(boolean isRequestMetricsEnabled, LogLevel connectionLogLevel); void updateNumParallelScans(long numParallelScans); void queryTimedOut(); void queryFailed(); void cacheRefreshedDueToSplits(); void startQuery(); void endQuery(); void startResultSetWatch(); void stopResultSetWatch(); Map<MetricType, Long> publish(); void reset(); OverAllQueryMetrics combine(OverAllQueryMetrics metric);  }