* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
*/
#pragma once
#include <unordered_map>
#include <string>
#include <memory>
#include <unordered_set>
#include "runtime/metrics/Metric.h"
namespace omnistream {
class TaskMetricGroup {
public:
TaskMetricGroup() = default;
~TaskMetricGroup();
void CleanMetrics();
void AddTaskIOMetric(const std::string& metricName, std::shared_ptr<Metric> metric);
void AddInternalOperatorIOMetric(const std::string& scope, const std::string& metricName,
std::shared_ptr<Metric> metric);
std::shared_ptr<Metric> GetTaskIOMetric(const std::string& metricName) const;
std::shared_ptr<Metric> GetInternalOperatorIOMetric(const std::string& operatorName,
const std::string& metricName) const;
std::unordered_set<std::string> GetOperatorNames() const;
private:
std::unordered_map<std::string, std::shared_ptr<Metric>> taskIOMetricGroup;
std::unordered_map<std::string, std::unordered_map<std::string, std::shared_ptr<Metric>>>
internalOperatorIOMetricGroup;
std::unordered_set<std::string> operatorNames;
};
}