use crate::physical_plan::metrics::{
Count, ExecutionPlanMetricsSet, MetricBuilder, Time,
};
#[derive(Debug, Clone)]
pub struct ParquetFileMetrics {
pub predicate_evaluation_errors: Count,
pub row_groups_matched_bloom_filter: Count,
pub row_groups_pruned_bloom_filter: Count,
pub row_groups_matched_statistics: Count,
pub row_groups_pruned_statistics: Count,
pub bytes_scanned: Count,
pub pushdown_rows_pruned: Count,
pub pushdown_rows_matched: Count,
pub row_pushdown_eval_time: Time,
pub statistics_eval_time: Time,
pub bloom_filter_eval_time: Time,
pub page_index_rows_pruned: Count,
pub page_index_rows_matched: Count,
pub page_index_eval_time: Time,
pub metadata_load_time: Time,
}
impl ParquetFileMetrics {
pub fn new(
partition: usize,
filename: &str,
metrics: &ExecutionPlanMetricsSet,
) -> Self {
let predicate_evaluation_errors = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("predicate_evaluation_errors", partition);
let row_groups_matched_bloom_filter = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("row_groups_matched_bloom_filter", partition);
let row_groups_pruned_bloom_filter = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("row_groups_pruned_bloom_filter", partition);
let row_groups_matched_statistics = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("row_groups_matched_statistics", partition);
let row_groups_pruned_statistics = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("row_groups_pruned_statistics", partition);
let bytes_scanned = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("bytes_scanned", partition);
let pushdown_rows_pruned = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("pushdown_rows_pruned", partition);
let pushdown_rows_matched = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("pushdown_rows_matched", partition);
let row_pushdown_eval_time = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.subset_time("row_pushdown_eval_time", partition);
let statistics_eval_time = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.subset_time("statistics_eval_time", partition);
let bloom_filter_eval_time = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.subset_time("bloom_filter_eval_time", partition);
let page_index_rows_pruned = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("page_index_rows_pruned", partition);
let page_index_rows_matched = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.counter("page_index_rows_matched", partition);
let page_index_eval_time = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.subset_time("page_index_eval_time", partition);
let metadata_load_time = MetricBuilder::new(metrics)
.with_new_label("filename", filename.to_string())
.subset_time("metadata_load_time", partition);
Self {
predicate_evaluation_errors,
row_groups_matched_bloom_filter,
row_groups_pruned_bloom_filter,
row_groups_matched_statistics,
row_groups_pruned_statistics,
bytes_scanned,
pushdown_rows_pruned,
pushdown_rows_matched,
row_pushdown_eval_time,
page_index_rows_pruned,
page_index_rows_matched,
statistics_eval_time,
bloom_filter_eval_time,
page_index_eval_time,
metadata_load_time,
}
}
}