Skip to content

Commit

Permalink
test(adjusted test due to a change in the setting method of stats.local
Browse files Browse the repository at this point in the history
#1105):

fix(main/metrics/timelines): separate variables for total and aggregated records in metrics and logon-summary #1105
  • Loading branch information
hitenkoku committed Jun 23, 2023
1 parent 02cbdfd commit 53bb207
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ impl App {
detection = detection.start(&self.rt, records_per_detect);
}
}
tl.stats.total += record_cnt;
tl.total_record_cnt += record_cnt;
(detection, record_cnt, tl)
}

Expand Down Expand Up @@ -1329,7 +1329,7 @@ impl App {
detection = detection.start(&self.rt, records_per_detect);
}
}
tl.stats.total += record_cnt;
tl.total_record_cnt += record_cnt;
(detection, record_cnt, tl)
}

Expand Down
1 change: 1 addition & 0 deletions src/timeline/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ impl EventMetrics {
check_start_end_time(&evttime);
};
}
self.total += records.len();
}

/// EventIDで集計
Expand Down
6 changes: 4 additions & 2 deletions src/timeline/timelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use hashbrown::{HashMap, HashSet};

#[derive(Debug, Clone)]
pub struct Timeline {
pub total_record_cnt: usize,
pub stats: EventMetrics,
pub event_search: EventSearch,
}
Expand Down Expand Up @@ -57,6 +58,7 @@ impl Timeline {
);
let search = EventSearch::new(filepath, search_result);
Timeline {
total_record_cnt: 0,
stats: statistic,
event_search: search,
}
Expand Down Expand Up @@ -99,7 +101,7 @@ impl Timeline {
let mut sammsges: Nested<String> = Nested::new();
let total_event_record = format!(
"\n\nTotal Event Records: {}\n",
self.stats.total.to_formatted_string(&Locale::en)
self.total_record_cnt.to_formatted_string(&Locale::en)
);
let mut wtr;
let target;
Expand Down Expand Up @@ -213,7 +215,7 @@ impl Timeline {
let mut sammsges: Vec<String> = Vec::new();
let total_event_record = format!(
"\n\nTotal Event Records: {}\n",
self.stats.total.to_formatted_string(&Locale::en)
self.total_record_cnt.to_formatted_string(&Locale::en)
);
if let Action::LogonSummary(logon_summary_option) =
&stored_static.config.action.as_ref().unwrap()
Expand Down

0 comments on commit 53bb207

Please sign in to comment.