//! Report filtering

use super::builder::BenchmarkReport;

/// Filter report by benchmark type
pub fn filter_by_type(
    report: &BenchmarkReport,
    include_network: bool,
    include_disk: bool,
    include_memory: bool,
    include_cpu: bool,
) -> BenchmarkReport {
    let mut filtered = BenchmarkReport::new();

    if include_network {
        filtered.network_results = report.network_results.clone();
    }

    if include_disk {
        filtered.disk_results = report.disk_results.clone();
    }

    if include_memory {
        filtered.memory_results = report.memory_results.clone();
    }

    if include_cpu {
        filtered.cpu_results = report.cpu_results.clone();
    }

    filtered.system_profile = report.system_profile.clone();
    filtered.timestamp = report.timestamp.clone();
    filtered.duration = report.duration;

    filtered
}
