Skip to content

Commit

Permalink
chore: extra logs to debug command
Browse files Browse the repository at this point in the history
  • Loading branch information
vladkens committed Oct 21, 2024
1 parent 079e544 commit e273822
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 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
@@ -1,6 +1,6 @@
[package]
name = "macmon"
version = "0.3.1"
version = "0.3.2"
edition = "2021"

[lints.rust]
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Options:

Controls:
c - change color
v - switch charts view: gauge / sparkline
q - quit
```

Expand Down
6 changes: 3 additions & 3 deletions src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use core_foundation::base::CFRelease;

use crate::sources::{
cfdict_keys, cfio_get_props, cfio_watts, get_dvfs_mhz, run_system_profiler, IOHIDSensors,
IOReport, IOServiceIterator, SMC,
cfdict_keys, cfio_get_props, cfio_get_residencies, cfio_watts, get_dvfs_mhz, run_system_profiler,
IOHIDSensors, IOReport, IOServiceIterator, SMC,
};

type WithError<T> = Result<T, Box<dyn std::error::Error>>;
Expand Down Expand Up @@ -62,7 +62,7 @@ pub fn print_debug() -> WithError<()> {
for x in ior.get_sample(dur) {
let msg = format!("{} :: {} :: {} ({}) =", x.group, x.subgroup, x.channel, x.unit);
match x.unit.as_str() {
"24Mticks" => println!("{}", msg),
"24Mticks" => println!("{} {:?}", msg, cfio_get_residencies(x.item)),
_ => println!("{} {:.2}W", msg, cfio_watts(x.item, &x.unit, dur)?),
}
}
Expand Down

0 comments on commit e273822

Please sign in to comment.