public Map<String, TopologyMetrics.ComponentMetric> getTopologyMetrics(Topology topology, String asUser) throws IOException { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); return topologyMetrics.getMetricsForTopology(CatalogToLayoutConverter.getTopologyLayout(topology), asUser); }
public TopologyMetrics.TopologyMetric getTopologyMetric(Topology topology, String asUser) throws IOException { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); return topologyMetrics.getTopologyMetric(CatalogToLayoutConverter.getTopologyLayout(topology), asUser); }
public TopologyTimeSeriesMetrics.TimeSeriesComponentMetric getTopologyStats(Topology topology, Long from, Long to, String asUser) throws IOException { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); return topologyMetrics.getTopologyStats(CatalogToLayoutConverter.getTopologyLayout(topology), from, to, asUser); }
public List<Pair<String, Double>> getTopNAndOtherComponentsLatency(Topology topology, String asUser, int nOfTopN) throws IOException { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); Map<String, TopologyMetrics.ComponentMetric> metricsForTopology = topologyMetrics .getMetricsForTopology(CatalogToLayoutConverter.getTopologyLayout(topology), asUser); List<Pair<String, Double>> topNAndOther = new ArrayList<>(); List<ImmutablePair<String, Double>> latencyOrderedComponents = metricsForTopology.entrySet().stream() .map((x) -> new ImmutablePair<>(x.getValue().getComponentName(), x.getValue().getProcessedTime())) // reversed sort .sorted((c1, c2) -> { if (c2.getValue() == null) { // assuming c1 is bigger return -1; } else { return c2.getValue().compareTo(c1.getValue()); } }) .collect(toList()); latencyOrderedComponents.stream().limit(nOfTopN).forEachOrdered(topNAndOther::add); double sumLatencyOthers = latencyOrderedComponents.stream() .skip(nOfTopN).filter((x) -> x.getValue() != null) .mapToDouble(Pair::getValue).sum(); topNAndOther.add(new ImmutablePair<>("Others", sumLatencyOthers)); return topNAndOther; }
public Map<Long, Double> getCompleteLatency(Topology topology, TopologyComponent component, long from, long to, String asUser) throws Exception { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); return topologyMetrics.getCompleteLatency(CatalogToLayoutConverter.getTopologyLayout(topology), CatalogToLayoutConverter.getComponentLayout(component), from, to, asUser); }
public TopologyTimeSeriesMetrics.TimeSeriesComponentMetric getComponentStats(Topology topology, TopologyComponent component, Long from, Long to, String asUser) throws IOException { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); return topologyMetrics.getComponentStats(CatalogToLayoutConverter.getTopologyLayout(topology), CatalogToLayoutConverter.getComponentLayout(component), from, to, asUser); }
public Map<String, Map<Long, Double>> getKafkaTopicOffsets(Topology topology, TopologyComponent component, Long from, Long to, String asUser) throws IOException { TopologyMetrics topologyMetrics = getTopologyMetricsInstance(topology); return topologyMetrics.getkafkaTopicOffsets(CatalogToLayoutConverter.getTopologyLayout(topology), CatalogToLayoutConverter.getComponentLayout(component), from, to, asUser); }