-
Notifications
You must be signed in to change notification settings - Fork 30
Fix visualization of interrupt data #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/data/interrupts.rs
Outdated
| fn get_prev_cpu_count(prev_data: InterruptLineData, cpu: u64) -> Result<u64> { | ||
| for cpu_data in prev_data.per_cpu { | ||
| if cpu_data.cpu == cpu { | ||
| return Ok(cpu_data.count); | ||
| } | ||
| } | ||
| return Err(PDError::VisualizerInterruptLineCPUCountError(format!("{}", cpu)).into()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not noticeable, but you're making this data collection ~32 times more expensive by having this linear search for CPU on every data point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not necessarily saying this has to change, but we do have these magical data structures that have O(1) lookups ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using that mythical data structure now.
src/lib.rs
Outdated
| #[error("Error getting Vmstat value for {}", .0)] | ||
| VisualizerVmstatValueGetError(String), | ||
|
|
||
| #[error("Error getting interrupt line coutn for CPU {}", .0)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eagle eye.
20d7390 to
eff5da1
Compare
The data from procfs for interrupts is cumulative. Data for time (t) = data for time (t) - data for time (t-1)
eff5da1 to
d2e4d9e
Compare
* add aperf standard report data format * modify graph data format, add already processed data handling
The data from procfs for interrupts is cumulative.
Data for time (t) = data for time (t) - data for time (t-1)