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:
Wind
2025-02-03 20:33:23 +08:00
committed by GitHub
parent 4424481487
commit 30b3c42b37
5 changed files with 11 additions and 24 deletions

View File

@ -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());

View File

@ -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

View File

@ -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() {