Skip to content

Commit

Permalink
chore: don't display zero metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed Oct 1, 2024
1 parent 141c6d6 commit 1f65b28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions sdk/scripts/metric_unify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def generate_markdown_tables(separated_dict, excluded_labels=["cycle_tracker_spa
metric = next((m for m in metrics if m.name == metric_name), None)
metric_str = ""
if metric:
if metric.value is None or metric.value == 0:
continue
metric_str += f"{metric.value:,}"
if metric.diff_percent is not None and metric.diff_value != 0:
color = "red" if metric.diff_percent > 0 else "green"
Expand Down
6 changes: 3 additions & 3 deletions vm/src/vm/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ mod emit {

for ((dsl_ir, opcode), value) in self.counts.iter() {
let labels = [
("opcode", opcode.clone()),
("dsl_ir", dsl_ir.clone().unwrap_or_else(String::new)),
("opcode", opcode.clone()),
];
counter!("frequency", &labels).absolute(*value as u64);
}

for ((dsl_ir, opcode, air_name), value) in self.trace_cells.iter() {
let labels = [
("air_name", air_name.clone()),
("opcode", opcode.clone()),
("dsl_ir", dsl_ir.clone().unwrap_or_else(String::new)),
("opcode", opcode.clone()),
("air_name", air_name.clone()),
];
counter!("cells_used", &labels).absolute(*value as u64);
}
Expand Down

0 comments on commit 1f65b28

Please sign in to comment.