Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
puffyCid committed Oct 8, 2024
1 parent 6b2251d commit 11dfd47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
17 changes: 11 additions & 6 deletions examples/unifiedlog_iterator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,16 @@ fn parse_trace_file(
archive_path.pop();
}

let exclude_missing = false;
let include_missing = false;
println!("Oversize cache size: {}", oversize_strings.oversize.len());
println!("Logs with missing Oversize strings: {}", missing_data.len());
println!("Checking Oversize cache one more time...");

// Since we have all Oversize entries now. Go through any log entries that we were not able to build before
for mut leftover_data in missing_data {
// Add all of our previous oversize data to logs for lookups
leftover_data
.oversize
.append(&mut oversize_strings.oversize.to_owned());
.oversize = oversize_strings.oversize.clone();

// Exclude_missing = false
// If we fail to find any missing data its probably due to the logs rolling
Expand All @@ -285,7 +287,7 @@ fn parse_trace_file(
string_results,
shared_strings_results,
timesync_data,
exclude_missing,
include_missing,
);
log_count += results.len();

Expand Down Expand Up @@ -324,9 +326,12 @@ fn iterate_chunks(
exclude_missing,
);
count += results.len();
oversize_strings.oversize.append(&mut chunk.oversize);
oversize_strings.oversize = chunk.oversize;
output(&results, writer).unwrap();
// Track oversize and missing log data
if missing_logs.catalog_data.is_empty() && missing_logs.header.is_empty() && missing_logs.oversize.is_empty() {
continue;
}
// Track possible missing log data due to oversize strings being in another file
missing.push(missing_logs);
}

Expand Down
6 changes: 4 additions & 2 deletions examples/unifiedlog_parser/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,15 @@ fn parse_trace_file(
}

exclude_missing = false;
println!("Oversize cache size: {}", oversize_strings.oversize.len());
println!("Logs with missing oversize strings: {}", missing_data.len());
println!("Checking Oversize cache one more time...");

// Since we have all Oversize entries now. Go through any log entries that we were not able to build before
for mut leftover_data in missing_data {
// Add all of our previous oversize data to logs for lookups
leftover_data
.oversize
.append(&mut oversize_strings.oversize.to_owned());
.oversize = oversize_strings.oversize.clone();

// Exclude_missing = false
// If we fail to find any missing data its probably due to the logs rolling
Expand Down

0 comments on commit 11dfd47

Please sign in to comment.