Conversation
yugesk
approved these changes
Feb 13, 2023
wash-amzn
reviewed
Feb 14, 2023
src/data/interrupts.rs
Outdated
Comment on lines
+253
to
+260
| 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()); | ||
| } |
Contributor
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
What do you suggest?
Contributor
There was a problem hiding this comment.
I'm not necessarily saying this has to change, but we do have these magical data structures that have O(1) lookups ....
Contributor
Author
There was a problem hiding this comment.
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)] |
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
wash-amzn
approved these changes
Feb 14, 2023
aperf-bot
pushed a commit
that referenced
this pull request
Oct 13, 2025
* add aperf standard report data format * modify graph data format, add already processed data handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The data from procfs for interrupts is cumulative.
Data for time (t) = data for time (t) - data for time (t-1)