Skip to content

Commit

Permalink
correct RIB file name filtering and collector name resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
SichangHe committed Dec 23, 2023
1 parent 35bea61 commit 4a12293
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions route_verification/rib_stats/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ fn main() {
let rib_files = read_dir("../../data/ribs")
.unwrap()
.map(|maybe_entry| maybe_entry.unwrap().path())
.filter(|path| path.is_file() && (path.ends_with(".gz") || path.ends_with(".bz2")))
.filter(|path| {
path.is_file() && {
let extension = path.extension().unwrap();
extension == "gz" || extension == "bz2"
}
})
.collect::<Vec<_>>();

let mut failed = vec![];
Expand Down Expand Up @@ -68,7 +73,10 @@ fn main() {
}

fn process_rib_file(query: &QueryIr, db: &AsRelDb, rib_file: &Path) -> Result<()> {
let rib_file_name = rib_file.to_string_lossy();
let rib_file_name = rib_file
.file_name()
.expect("RIB file should have a name.")
.to_string_lossy();
let collector = rib_file_name
.split("--")
.next()
Expand Down

0 comments on commit 4a12293

Please sign in to comment.