1
mod rewriter_stats;
2
mod solver_stats;
3

            
4
pub use rewriter_stats::RewriterStats;
5
use schemars::JsonSchema;
6
use serde::Serialize;
7
use serde_with::skip_serializing_none;
8
pub use solver_stats::SolverStats;
9

            
10
#[allow(dead_code)]
11
#[skip_serializing_none]
12
#[derive(Default, Serialize, Clone, JsonSchema)]
13
#[serde(rename_all = "camelCase")]
14
pub struct Stats {
15
    pub solver_runs: Vec<SolverStats>,
16
    pub rewriter_runs: Vec<RewriterStats>,
17
}
18

            
19
impl Stats {
20
    pub fn new() -> Stats {
21
        Default::default()
22
    }
23

            
24
525
    pub fn add_solver_run(&mut self, solver_stats: SolverStats) {
25
525
        self.solver_runs.push(solver_stats);
26
525
    }
27

            
28
675
    pub fn add_rewriter_run(&mut self, rewriter_stats: RewriterStats) {
29
675
        self.rewriter_runs.push(rewriter_stats);
30
675
    }
31
}