use std::time::Duration;
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum JoinAlgorithm {
NestedLoop,
Hash,
SortMerge,
IndexNestedLoop,
}
#[derive(Debug, Clone, Default)]
pub struct ExecutionStats {
pub execution_time: Duration,
pub intermediate_results: usize,
pub final_results: usize,
pub memory_used: usize,
pub operations: usize,
pub property_path_evaluations: usize,
pub time_spent_on_paths: Duration,
pub service_calls: usize,
pub time_spent_on_services: Duration,
pub warnings: Vec<String>,
}
impl ExecutionStats {
pub fn new() -> Self {
Self::default()
}
pub fn merge_from(&mut self, other: &ExecutionStats) {
self.execution_time += other.execution_time;
self.intermediate_results += other.intermediate_results;
self.final_results += other.final_results;
self.memory_used += other.memory_used;
self.operations += other.operations;
self.property_path_evaluations += other.property_path_evaluations;
self.time_spent_on_paths += other.time_spent_on_paths;
self.service_calls += other.service_calls;
self.time_spent_on_services += other.time_spent_on_services;
self.warnings.extend(other.warnings.clone());
}
pub fn add_warning(&mut self, warning: String) {
self.warnings.push(warning);
}
pub fn increment_operations(&mut self) {
self.operations += 1;
}
pub fn add_memory_usage(&mut self, bytes: usize) {
self.memory_used += bytes;
}
}