forked from extern/nushell
update sysinfo to 0.33.1 (#14982)
Noticed by #14951 , there are some breaking changes in sysinfo 0.33. So I create a pr manually to update it
This commit is contained in:
@ -54,7 +54,7 @@ impl Command for DebugInfo {
|
||||
}
|
||||
|
||||
fn all_columns(span: Span) -> Value {
|
||||
let rk = RefreshKind::new()
|
||||
let rk = RefreshKind::nothing()
|
||||
.with_processes(ProcessRefreshKind::everything())
|
||||
.with_memory(MemoryRefreshKind::everything());
|
||||
|
||||
|
@ -54,9 +54,9 @@ fn cpu(long: bool, span: Span) -> Value {
|
||||
// In theory we could just sleep MINIMUM_CPU_UPDATE_INTERVAL, but I've noticed that
|
||||
// that gives poor results (error of ~5%). Decided to wait 2x that long, somewhat arbitrarily
|
||||
std::thread::sleep(MINIMUM_CPU_UPDATE_INTERVAL * 2);
|
||||
sys.refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage());
|
||||
sys.refresh_cpu_specifics(CpuRefreshKind::nothing().with_cpu_usage());
|
||||
} else {
|
||||
sys.refresh_cpu_specifics(CpuRefreshKind::new().with_frequency());
|
||||
sys.refresh_cpu_specifics(CpuRefreshKind::nothing().with_frequency());
|
||||
}
|
||||
|
||||
let cpus = sys
|
||||
|
@ -49,8 +49,8 @@ fn temp(span: Span) -> Value {
|
||||
.map(|component| {
|
||||
let mut record = record! {
|
||||
"unit" => Value::string(component.label(), span),
|
||||
"temp" => Value::float(component.temperature().into(), span),
|
||||
"high" => Value::float(component.max().into(), span),
|
||||
"temp" => Value::float(component.temperature().unwrap_or(f32::NAN).into(), span),
|
||||
"high" => Value::float(component.max().unwrap_or(f32::NAN).into(), span),
|
||||
};
|
||||
|
||||
if let Some(critical) = component.critical() {
|
||||
|
Reference in New Issue
Block a user