24#include <unordered_map>
28#include "iceberg/iceberg_export.h"
29#include "iceberg/metrics/commit_report.h"
30#include "iceberg/metrics/scan_report.h"
31#include "iceberg/result.h"
36enum class MetricsReportType {
42ICEBERG_EXPORT
constexpr std::string_view ToString(MetricsReportType type)
noexcept {
44 case MetricsReportType::kScanReport:
46 case MetricsReportType::kCommitReport:
56using MetricsReport = std::variant<ScanReport, CommitReport>;
62ICEBERG_EXPORT
inline MetricsReportType GetReportType(
const MetricsReport& report) {
64 [](
const auto& r) -> MetricsReportType {
65 using T = std::decay_t<
decltype(r)>;
66 if constexpr (std::is_same_v<T, ScanReport>) {
67 return MetricsReportType::kScanReport;
69 return MetricsReportType::kCommitReport;
92 [[maybe_unused]]
const std::unordered_map<std::string, std::string>& properties) {
102 virtual Status
Report(
const MetricsReport& report) = 0;
Interface for reporting metrics from Iceberg operations.
Definition metrics_reporter.h:82
virtual Status Initialize(const std::unordered_map< std::string, std::string > &properties)
Initialize the reporter with catalog properties after construction.
Definition metrics_reporter.h:91
virtual Status Report(const MetricsReport &report)=0
Report a metrics report.