Skip to content

Commit

Permalink
fix route stats evcxr eg header printing
Browse files Browse the repository at this point in the history
  • Loading branch information
SichangHe committed Nov 8, 2023
1 parent 9812c26 commit df2f97e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion route_verification/bgp/src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub enum ReportItem {
UnrecImportEmpty,
UnrecExportEmpty,

// Unrecorded.
// Unrecorded RPSL Objects.
UnrecordedFilterSet(String),
UnrecordedAsRoutes(u32),
UnrecordedRouteSet(String),
Expand Down
8 changes: 6 additions & 2 deletions route_verification/src/evcxr_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ before running Evcxr is also needed.
:dep route_verification = { path = "route_verification" }
:dep rayon
:dep itertools
:dep polars = { features = ["describe"] }
// */
use anyhow::Result;
use dashmap::DashMap;
use itertools::multiunzip;
use polars::prelude::*;
use rayon::prelude::*;
use route_verification::as_rel::*;
use route_verification::bgp::stats::*;
Expand All @@ -50,6 +48,12 @@ use std::{
time::Instant,
};

// If Polars is needed:
/*
:dep polars = { features = ["describe"] }
use polars::prelude::*;
*/

fn read_parsed_rpsl() -> Result<()> {
let start = Instant::now();
let parsed = Ir::pal_read("parsed_all")?;
Expand Down
3 changes: 2 additions & 1 deletion route_verification/src/evcxr_examples/route_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fn gen_route_stats(query: QueryIr, mut bgp_lines: Vec<Line>, db: AsRelDb) -> Res
"
.split_ascii_whitespace()
.collect();
file.write_all(header.as_bytes());
file.write_all(header.trim_end_matches(",").as_bytes());
file.write_all(b"\n");
let comma = b","[0];
for s in stats {
let RouteStats {
Expand Down

0 comments on commit df2f97e

Please sign in to comment.