Skip to content

Commit

Permalink
Tune flames to look closer to the CPU load
Browse files Browse the repository at this point in the history
Before this change, 100% CPU load looked like maybe 85% judging by flame
height.

With this change in place, 100% CPU load looks like 100% flame height.
  • Loading branch information
walles committed Jul 8, 2023
1 parent 05ab897 commit d21dd14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Binary file modified libloadviz/screenshot.webp
Binary file not shown.
5 changes: 4 additions & 1 deletion libloadviz/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ impl Renderer {
let cooling_factor = if y_from_bottom_0_to_1 > bottom_cooling_layer_thickness_0_to_1 {
// Cool based on the percentage of the flame height. This looks better in general.
let fraction_of_current_height = y_from_bottom_0_to_1 / cpu_load.user_0_to_1;
1.0 - fraction_of_current_height

// "0.7" makes 100% load look like 100% flame height. Without that
// factor, 100% load looked like maybe 80% flame height.
1.0 - fraction_of_current_height * 0.7
} else {
// Cool based on a fraction of the image height. This looks better
// for low CPU loads / flame heights.
Expand Down
Binary file modified macos/loadviz.icns
Binary file not shown.

0 comments on commit d21dd14

Please sign in to comment.