Skip to content

Commit

Permalink
chore: ignore unsure execution contexts;evcxr example to test aggrega…
Browse files Browse the repository at this point in the history
…ting
  • Loading branch information
SichangHe committed Oct 9, 2024
1 parent 6097aad commit 8b3be0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsphere_vv8_log/src/aggregating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ impl RecordAggregate {
None
}

// Ignore unsure execution contexts.
LogRecord::ExecutionContext { script_id } if script_id == ID_UNSURE => None,

LogRecord::ExecutionContext { script_id } => {
self.current_script_id = script_id;
let script = self.current_script()?;
Expand Down
9 changes: 9 additions & 0 deletions jsphere_vv8_log/src/evcxr_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,13 @@ fn main() {
}
}
}

// Aggregate API calls.
let mut aggregate = RecordAggregate::default();
for entry in &logs[2].records {
let (line, record) = entry.clone();
if let Err(err) = aggregate.add(line, record) {
println!("{line}: {err}");
}
}
}

0 comments on commit 8b3be0a

Please sign in to comment.