Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ anstyle-parse = "1.0"
unicode-segmentation = "1.13"
rayon = "1"
socket2 = "0.5"
someip-messages = { git = "https://github.com/esrlabs/someip" }
someip-messages = { git = "https://github.com/esrlabs/someip", rev = "59b27a6689d72948c4569bc6037c2387c1a661ed" }
tar = "0.4"
flate2 = "1.1"

Expand Down
2 changes: 2 additions & 0 deletions crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ blake3.workspace = true
nucleo-matcher.workspace = true
anstyle-parse.workspace = true
unicode-segmentation.workspace = true
pcap-parser.workspace = true
someip-messages.workspace = true

#TODO: Replace env logger with log4rs
env_logger.workspace = true
Expand Down
7 changes: 7 additions & 0 deletions crates/app/src/host/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub enum HostCommand {
/// Reopen a recent-session snapshot with the requested intent.
OpenRecentSession(Box<OpenRecentSessionParam>),
DltStatistics(Box<DltStatisticsParam>),
SomeipStatistics(Box<SomeipStatisticsParam>),
StartSession(Box<StartSessionParam>),
/// Imports named presets from the provided file.
ImportPresets(PathBuf),
Expand Down Expand Up @@ -112,6 +113,12 @@ pub struct DltStatisticsParam {
pub source_paths: Vec<PathBuf>,
}

#[derive(Debug, Clone)]
pub struct SomeipStatisticsParam {
pub session_setup_id: Uuid,
pub source_paths: Vec<PathBuf>,
}

#[derive(Debug, Clone)]
pub struct ScanFavoriteFoldersParam {
/// Local request identifier echoed back with the scan result.
Expand Down
10 changes: 9 additions & 1 deletion crates/app/src/host/common/dlt_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ pub fn dlt_statistics(sources: Vec<PathBuf>) -> Result<DltStatistics, String> {
/// The statistics-info of DLT files.
#[derive(Debug, Default, Clone)]
pub struct DltStatistics {
/// The total number of DLT messages.
counter: usize,
/// The overall distribution of log-levels.
pub total: LevelDistribution,
/// The app-id specific distribution of log-levels.
pub app_ids: FxHashMap<String, LevelDistribution>,
// The context-id specific distribution of log-levels.
pub ctx_ids: FxHashMap<String, LevelDistribution>,
/// The ecu-id specific distribution of log-levels.
pub ecu_ids: FxHashMap<String, LevelDistribution>,
}

impl DltStatistics {
/// Returns the total number of message-ids.
pub fn count(&self) -> usize {
self.app_ids.len() + self.ctx_ids.len() + self.ecu_ids.len()
}
}

/// The Level distribution of DLT messages.
/// The level distribution of DLT messages.
#[derive(Debug, Default, Clone)]
pub struct LevelDistribution {
pub fatal: FxHashSet<usize>,
Expand All @@ -57,6 +63,7 @@ pub struct LevelDistribution {
}

impl LevelDistribution {
/// Returns the total number of messages.
pub fn count(&self) -> usize {
self.fatal.len()
+ self.error.len()
Expand All @@ -68,6 +75,7 @@ impl LevelDistribution {
+ self.invalid.len()
}

/// Returns the type specific numbers of messages.
pub fn values(&self) -> [usize; 8] {
[
self.fatal.len(),
Expand Down
1 change: 1 addition & 0 deletions crates/app/src/host/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ pub mod colors;
pub mod dlt_stats;
pub mod file_utls;
pub mod parsers;
pub mod someip_stats;
pub mod sources;
pub mod ui_utls;
Loading
Loading