Per-stage computation times
This commit is contained in:
parent
fe7ba339b5
commit
6162bae1ac
@ -90,6 +90,16 @@ pub fn get_directives(language_state: &mut Box<ProgrammingLanguageInterface>) ->
|
|||||||
None
|
None
|
||||||
})),
|
})),
|
||||||
CommandTree::terminal("off", None, vec![], Box::new(turn_off)),
|
CommandTree::terminal("off", None, vec![], Box::new(turn_off)),
|
||||||
|
]),
|
||||||
|
CommandTree::nonterm("stage-times", Some("Computation time per-stage"), vec![
|
||||||
|
CommandTree::terminal("on", None, vec![], Box::new(|repl: &mut Repl, _: &[&str]| {
|
||||||
|
repl.options.show_stage_times = true;
|
||||||
|
None
|
||||||
|
})),
|
||||||
|
CommandTree::terminal("off", None, vec![], Box::new(|repl: &mut Repl, _: &[&str]| {
|
||||||
|
repl.options.show_stage_times = false;
|
||||||
|
None
|
||||||
|
})),
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
@ -197,6 +197,10 @@ impl Repl {
|
|||||||
buf.push_str(&format!("Total duration: {:?}\n", response.global_output_stats.total_duration));
|
buf.push_str(&format!("Total duration: {:?}\n", response.global_output_stats.total_duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.options.show_stage_times {
|
||||||
|
buf.push_str(&format!("{:?}\n", response.global_output_stats.stage_durations));
|
||||||
|
}
|
||||||
|
|
||||||
buf.push_str(&match response.main_output {
|
buf.push_str(&match response.main_output {
|
||||||
Ok(s) => s,
|
Ok(s) => s,
|
||||||
Err(e) => format!("{} {}", "Error".red(), e)
|
Err(e) => format!("{} {}", "Error".red(), e)
|
||||||
|
@ -8,6 +8,7 @@ use std::fs::File;
|
|||||||
pub struct ReplOptions {
|
pub struct ReplOptions {
|
||||||
pub debug_asks: HashSet<DebugAsk>,
|
pub debug_asks: HashSet<DebugAsk>,
|
||||||
pub show_total_time: bool,
|
pub show_total_time: bool,
|
||||||
|
pub show_stage_times: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ReplOptions {
|
impl ReplOptions {
|
||||||
@ -15,6 +16,7 @@ impl ReplOptions {
|
|||||||
ReplOptions {
|
ReplOptions {
|
||||||
debug_asks: HashSet::new(),
|
debug_asks: HashSet::new(),
|
||||||
show_total_time: true,
|
show_total_time: true,
|
||||||
|
show_stage_times: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user