Search in sources :

Example 1 with ComponentMetricStore

use of org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore.ComponentMetricStore in project flink by apache.

the class JobVertexBackPressureHandler method createSubtaskBackPressureInfo.

private List<SubtaskBackPressureInfo> createSubtaskBackPressureInfo(Map<Integer, ComponentMetricStore> subtaskMetricStores) {
    List<SubtaskBackPressureInfo> result = new ArrayList<>(subtaskMetricStores.size());
    for (Map.Entry<Integer, ComponentMetricStore> entry : subtaskMetricStores.entrySet()) {
        int subtaskIndex = entry.getKey();
        ComponentMetricStore subtaskMetricStore = entry.getValue();
        double backPressureRatio = getBackPressureRatio(subtaskMetricStore);
        double idleRatio = getIdleRatio(subtaskMetricStore);
        double busyRatio = getBusyRatio(subtaskMetricStore);
        result.add(new SubtaskBackPressureInfo(subtaskIndex, getBackPressureLevel(backPressureRatio), backPressureRatio, idleRatio, busyRatio));
    }
    result.sort(Comparator.comparingInt(SubtaskBackPressureInfo::getSubtask));
    return result;
}
Also used : ArrayList(java.util.ArrayList) ComponentMetricStore(org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore.ComponentMetricStore) SubtaskBackPressureInfo(org.apache.flink.runtime.rest.messages.JobVertexBackPressureInfo.SubtaskBackPressureInfo) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 ComponentMetricStore (org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore.ComponentMetricStore)1 SubtaskBackPressureInfo (org.apache.flink.runtime.rest.messages.JobVertexBackPressureInfo.SubtaskBackPressureInfo)1