mirror of
https://github.com/nushell/nushell.git
synced 2025-06-01 07:35:49 +02:00
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:
parent
4424481487
commit
30b3c42b37
23
Cargo.lock
generated
23
Cargo.lock
generated
@ -3516,7 +3516,7 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"reedline",
|
"reedline",
|
||||||
"rstest",
|
"rstest",
|
||||||
"sysinfo 0.32.1",
|
"sysinfo",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"uuid",
|
"uuid",
|
||||||
@ -3682,7 +3682,7 @@ dependencies = [
|
|||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"sha2",
|
"sha2",
|
||||||
"sysinfo 0.32.1",
|
"sysinfo",
|
||||||
"tabled",
|
"tabled",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"titlecase",
|
"titlecase",
|
||||||
@ -3975,7 +3975,7 @@ dependencies = [
|
|||||||
"nix 0.29.0",
|
"nix 0.29.0",
|
||||||
"ntapi",
|
"ntapi",
|
||||||
"procfs",
|
"procfs",
|
||||||
"sysinfo 0.32.1",
|
"sysinfo",
|
||||||
"web-time",
|
"web-time",
|
||||||
"windows 0.56.0",
|
"windows 0.56.0",
|
||||||
]
|
]
|
||||||
@ -5365,7 +5365,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"stacker",
|
"stacker",
|
||||||
"sysinfo 0.33.1",
|
"sysinfo",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -6934,20 +6934,6 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sysinfo"
|
|
||||||
version = "0.32.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4c33cd241af0f2e9e3b5c32163b873b29956890b5342e6745b917ce9d490f4af"
|
|
||||||
dependencies = [
|
|
||||||
"core-foundation-sys",
|
|
||||||
"libc",
|
|
||||||
"memchr",
|
|
||||||
"ntapi",
|
|
||||||
"rayon",
|
|
||||||
"windows 0.57.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sysinfo"
|
name = "sysinfo"
|
||||||
version = "0.33.1"
|
version = "0.33.1"
|
||||||
@ -6958,6 +6944,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"memchr",
|
"memchr",
|
||||||
"ntapi",
|
"ntapi",
|
||||||
|
"rayon",
|
||||||
"windows 0.57.0",
|
"windows 0.57.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ serde_yaml = "0.9.33"
|
|||||||
sha2 = "0.10"
|
sha2 = "0.10"
|
||||||
strip-ansi-escapes = "0.2.0"
|
strip-ansi-escapes = "0.2.0"
|
||||||
syn = "2.0"
|
syn = "2.0"
|
||||||
sysinfo = "0.32"
|
sysinfo = "0.33"
|
||||||
tabled = { version = "0.17.0", default-features = false }
|
tabled = { version = "0.17.0", default-features = false }
|
||||||
tempfile = "3.15"
|
tempfile = "3.15"
|
||||||
titlecase = "3.0"
|
titlecase = "3.0"
|
||||||
|
@ -54,7 +54,7 @@ impl Command for DebugInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn all_columns(span: Span) -> Value {
|
fn all_columns(span: Span) -> Value {
|
||||||
let rk = RefreshKind::new()
|
let rk = RefreshKind::nothing()
|
||||||
.with_processes(ProcessRefreshKind::everything())
|
.with_processes(ProcessRefreshKind::everything())
|
||||||
.with_memory(MemoryRefreshKind::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
|
// 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
|
// that gives poor results (error of ~5%). Decided to wait 2x that long, somewhat arbitrarily
|
||||||
std::thread::sleep(MINIMUM_CPU_UPDATE_INTERVAL * 2);
|
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 {
|
} else {
|
||||||
sys.refresh_cpu_specifics(CpuRefreshKind::new().with_frequency());
|
sys.refresh_cpu_specifics(CpuRefreshKind::nothing().with_frequency());
|
||||||
}
|
}
|
||||||
|
|
||||||
let cpus = sys
|
let cpus = sys
|
||||||
|
@ -49,8 +49,8 @@ fn temp(span: Span) -> Value {
|
|||||||
.map(|component| {
|
.map(|component| {
|
||||||
let mut record = record! {
|
let mut record = record! {
|
||||||
"unit" => Value::string(component.label(), span),
|
"unit" => Value::string(component.label(), span),
|
||||||
"temp" => Value::float(component.temperature().into(), span),
|
"temp" => Value::float(component.temperature().unwrap_or(f32::NAN).into(), span),
|
||||||
"high" => Value::float(component.max().into(), span),
|
"high" => Value::float(component.max().unwrap_or(f32::NAN).into(), span),
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(critical) = component.critical() {
|
if let Some(critical) = component.critical() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user