MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / run_stats_watch

Function run_stats_watch

packages/server/src/main/service_client.rs:62–74  ·  view source on GitHub ↗
(
    server_url: &str,
    udid: &str,
    pid: Option<i32>,
    interval: f64,
)

Source from the content-addressed store, hash-verified

60}
61
62fn run_stats_watch(
63 server_url: &str,
64 udid: &str,
65 pid: Option<i32>,
66 interval: f64,
67) -> anyhow::Result<()> {
68 let interval = Duration::from_secs_f64(interval.clamp(0.25, 60.0));
69 loop {
70 let stats = service_performance_json(server_url, udid, pid)?;
71 print_performance_line(&stats)?;
72 std::thread::sleep(interval);
73 }
74}
75
76fn print_performance_line(stats: &Value) -> anyhow::Result<()> {
77 let current = stats

Callers 1

mainFunction · 0.85

Calls 3

service_performance_jsonFunction · 0.85
print_performance_lineFunction · 0.85
sleepFunction · 0.50

Tested by

no test coverage detected