chore: remove unused import and redundant parameters
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
windows_subsystem = "windows"
|
windows_subsystem = "windows"
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use sysinfo::{System, Pid};
|
use sysinfo::System;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use tauri::State;
|
use tauri::State;
|
||||||
@@ -164,7 +164,6 @@ fn get_syspulse_pids(self_pid: u32, sys: &System) -> HashSet<u32> {
|
|||||||
|
|
||||||
fn collect_snapshot(
|
fn collect_snapshot(
|
||||||
sys: &mut System,
|
sys: &mut System,
|
||||||
self_pid: u32,
|
|
||||||
syspulse_pids: &HashSet<u32>,
|
syspulse_pids: &HashSet<u32>,
|
||||||
pss_cache: &mut HashMap<u32, (u64, DateTime<Utc>)>,
|
pss_cache: &mut HashMap<u32, (u64, DateTime<Utc>)>,
|
||||||
collect_pss: bool
|
collect_pss: bool
|
||||||
@@ -357,7 +356,7 @@ fn get_system_stats(state: State<AppState>, minimal: bool) -> SystemStats {
|
|||||||
|
|
||||||
// NO PSS collection during live dashboard. ONLY during profiling or after.
|
// NO PSS collection during live dashboard. ONLY during profiling or after.
|
||||||
// This is the primary cause of high CPU/I/O.
|
// This is the primary cause of high CPU/I/O.
|
||||||
let snapshot = collect_snapshot(&mut sys, self_pid, &syspulse_pids, &mut pss_cache, profiling.is_active);
|
let snapshot = collect_snapshot(&mut sys, &syspulse_pids, &mut pss_cache, profiling.is_active);
|
||||||
|
|
||||||
if profiling.is_active {
|
if profiling.is_active {
|
||||||
profiling.snapshots.push(snapshot.clone());
|
profiling.snapshots.push(snapshot.clone());
|
||||||
@@ -450,7 +449,7 @@ fn main() {
|
|||||||
|
|
||||||
for i in 0..(cli.duration * 1000 / cli.interval) {
|
for i in 0..(cli.duration * 1000 / cli.interval) {
|
||||||
let syspulse_pids = get_syspulse_pids(self_pid, &sys);
|
let syspulse_pids = get_syspulse_pids(self_pid, &sys);
|
||||||
snapshots.push(collect_snapshot(&mut sys, self_pid, &syspulse_pids, &mut pss_cache, true));
|
snapshots.push(collect_snapshot(&mut sys, &syspulse_pids, &mut pss_cache, true));
|
||||||
std::thread::sleep(Duration::from_millis(cli.interval));
|
std::thread::sleep(Duration::from_millis(cli.interval));
|
||||||
if (i + 1) % (1000 / cli.interval) == 0 {
|
if (i + 1) % (1000 / cli.interval) == 0 {
|
||||||
println!(" Progress: {}/{}s", (i + 1) * cli.interval / 1000, cli.duration);
|
println!(" Progress: {}/{}s", (i + 1) * cli.interval / 1000, cli.duration);
|
||||||
|
|||||||
Reference in New Issue
Block a user