nushell/crates/nu-command/src/system
Reilly Wood f93033c20b
Fix CPU usage info in sys (#8321)
Closes #8264. This PR does a few things to fix the `usage` column in
`sys.cpu`:

1. Sleep a while (~400ms) between calls to `sys.refresh_cpu()`, [as
required by
`sysinfo`](https://docs.rs/sysinfo/latest/sysinfo/trait.SystemExt.html#method.refresh_cpu)
2. Change `sys` to return a `LazyRecord` (so you can do things like `sys
| get host` instantly without waiting for CPU info)
3. Update our `sysinfo` dependency to [fix CPU usage calculations on
Linux](https://github.com/GuillaumeGomez/sysinfo/pull/946)

CPU usage is no longer always reported as zero:


![image](https://user-images.githubusercontent.com/26268125/222929775-5e9cbe18-95d9-4ecb-baf8-1e843f5c7086.png)
2023-03-04 14:48:34 -08:00
..
complete.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
exec.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
mod.rs relocate debug commands (#8071) 2023-02-13 16:39:07 +00:00
nu_check.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
ps.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
registry_query.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
run_external.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
sys.rs Fix CPU usage info in sys (#8321) 2023-03-04 14:48:34 -08:00
which_.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00