private static void fillTLCValue2Edge(List<MetricInfo> componentMetrics, Map<String, TopologyEdge> edges) {
        String EDGE_DIM = "." + MetricDef.TUPLE_LIEF_CYCLE;
        for (MetricInfo info : componentMetrics) {
            if (info == null) continue;
            for (Map.Entry<String, Map<Integer, MetricSnapshot>> metric : info.get_metrics().entrySet()) {
                String name = metric.getKey();
                String[] split_name = name.split("@");
                String metricName = UIMetricUtils.extractMetricName(split_name);

                // only handle with `.TupleLifeCycle` metrics
                if (metricName == null || !metricName.contains(EDGE_DIM)) {
                    continue;
                }
                String componentId = UIMetricUtils.extractComponentName(split_name);
                String src = metricName.split("\\.")[0];
                String key = src + ":" + componentId;

                //get 60 window metric
                MetricSnapshot snapshot = metric.getValue().get(AsmWindow.M1_WINDOW);
                TopologyEdge edge = edges.get(key);
                if (edge != null) {
                    double value = snapshot.get_mean() / 1000;
                    edge.setCycleValue(value);
                    edge.appendTitle("TupleLifeCycle: " +
                            UIMetricUtils.format.format(value) + "ms");

                    for (Map.Entry<Integer, MetricSnapshot> winData : metric.getValue().entrySet()) {
                        // put the tuple life cycle time , unit is ms
                        double v = winData.getValue().get_mean() / 1000;
                        edge.putMapValue(MetricDef.TUPLE_LIEF_CYCLE + "(ms)", winData.getKey(),
                                UIMetricUtils.format.format(v));
                    }
                }
            }
        }
    }
private static void fillTLCValue2Edge ( List < MetricInfo > componentMetrics , Map < String , TopologyEdge > edges ) { String EDGE_DIM = "." + MetricDef . TUPLE_LIEF_CYCLE ; for ( MetricInfo info : componentMetrics ) { if ( info == null ) continue ; for ( Map . Entry < String , Map < Integer , MetricSnapshot > > metric : info . get_metrics ( ) . entrySet ( ) ) { String name = metric . getKey ( ) ; String [ ] split_name = name . split ( "@" ) ; String metricName = UIMetricUtils . extractMetricName ( split_name ) ; if ( metricName == null || ! metricName . contains ( EDGE_DIM ) ) { continue ; } String componentId = UIMetricUtils . extractComponentName ( split_name ) ; String src = metricName . split ( "\\." ) [ 0 ] ; String key = src + ":" + componentId ; MetricSnapshot snapshot = metric . getValue ( ) . get ( AsmWindow . M1_WINDOW ) ; TopologyEdge edge = edges . get ( key ) ; if ( edge != null ) { double value = snapshot . get_mean ( ) / 1000 ; edge . setCycleValue ( value ) ; edge . appendTitle ( "TupleLifeCycle: " + UIMetricUtils . format . format ( value ) + "ms" ) ; for ( Map . Entry < Integer , MetricSnapshot > winData : metric . getValue ( ) . entrySet ( ) ) { double v = winData . getValue ( ) . get_mean ( ) / 1000 ; edge . putMapValue ( MetricDef . TUPLE_LIEF_CYCLE + "(ms)" , winData . getKey ( ) , UIMetricUtils . format . format ( v ) ) ; } } } } }
fill tuple life cycle time to edges