fix: telemetry reporter field name cpu_percent, add type annotation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -689,11 +689,11 @@ async fn build_telemetry_report(
|
||||
|
||||
// Latest metrics snapshot
|
||||
let latest = store.latest().await;
|
||||
let (cpu_pct, mem_pct, disk_pct) = latest.map(|s| {
|
||||
let (cpu_pct, mem_pct, disk_pct): (f64, f64, f64) = latest.map(|s| {
|
||||
let mem_total = s.system.mem_total_bytes as f64;
|
||||
let disk_total = s.system.disk_total_bytes as f64;
|
||||
(
|
||||
s.system.cpu_usage_percent,
|
||||
s.system.cpu_percent,
|
||||
if mem_total > 0.0 { (s.system.mem_used_bytes as f64 / mem_total) * 100.0 } else { 0.0 },
|
||||
if disk_total > 0.0 { (s.system.disk_used_bytes as f64 / disk_total) * 100.0 } else { 0.0 },
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user