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;
}
Aggregations