($name:tt, $rustic_name:ident) => {
let (hits, total) = self.query_counts.$rustic_name;
let (hits, total) = if total > 0 {
($name:tt, $rustic_name:ident) => {
let (hits, total) = self.query_counts.$rustic_name;
let (hits, total) = if total > 0 {
- writeln!(lock, "| Phase | Time (ms) | Queries | Hits (%) |").unwrap();
- writeln!(lock, "| ---------------- | -------------- | -------------- | -------- |").unwrap();
+ writeln!(lock, "| Phase | Time (ms) | Queries | Hits (%) |")
+ .unwrap();
+ writeln!(lock, "| ---------------- | -------------- | -------------- | -------- |")
+ .unwrap();
($category:tt, $rustic_name:ident) => {{
let (hits, total) = self.query_counts.$rustic_name;
($category:tt, $rustic_name:ident) => {{
let (hits, total) = self.query_counts.$rustic_name;
- format!("{{ \"category\": {}, \"time_ms\": {}, \"query_count\": {}, \"query_hits\": {} }}",
+ format!(
+ "{{ \"category\": {}, \"time_ms\": {},
+ \"query_count\": {}, \"query_hits\": {} }}",
pub fn end_activity(&mut self, category: ProfileCategory) {
match self.timer_stack.pop() {
None => bug!("end_activity() was called but there was no running activity"),
pub fn end_activity(&mut self, category: ProfileCategory) {
match self.timer_stack.pop() {
None => bug!("end_activity() was called but there was no running activity"),
let elapsed = self.stop_timer();
let new_time = self.data.times.get(category) + elapsed;
self.data.times.set(category, new_time);
let elapsed = self.stop_timer();
let new_time = self.data.times.get(category) + elapsed;
self.data.times.set(category, new_time);
pub fn print_results(&mut self, opts: &Options) {
self.end_activity(ProfileCategory::Other);
pub fn print_results(&mut self, opts: &Options) {
self.end_activity(ProfileCategory::Other);
pub fn save_results(&self, opts: &Options) {
let category_data = self.data.json();
pub fn save_results(&self, opts: &Options) {
let category_data = self.data.json();
- let compilation_options = format!("{{ \"optimization_level\": \"{:?}\", \"incremental\": {} }}",
- opts.optimize,
- if opts.incremental.is_some() { "true" } else { "false" });
+ let compilation_options =
+ format!("{{ \"optimization_level\": \"{:?}\", \"incremental\": {} }}",
+ opts.optimize,
+ if opts.incremental.is_some() { "true" } else { "false" });