Skip to content

Commit bb206a3

Browse files
Fix tick stat parsing
Fix the logic that is parsing the output of tick stats returned by the server. At some point, the returned string was modified and was failing to parse properly.
1 parent 63e6530 commit bb206a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/core/server/client.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ impl Client {
6969
run_command(&self.0, actor::Command::Other("tick query".to_string())).await?;
7070

7171
// Example server output:
72-
// Target tick rate: 20.0 per second.
73-
// Average time per tick: 13.2ms (Target: 50.0ms)
74-
// Percentiles: P50: 13.0ms P95: 16.0ms P99: 18.6ms, sample: 100
75-
let tick_stats_stripped = tick_stats.replace([':', ',', '(', ')'], " ");
72+
// > The game is running normally
73+
// > Target tick rate: 20.0 per second.
74+
// > Average time per tick: 0.0ms (Target: 50.0ms)
75+
// > Percentiles: P50: 0.0ms P95: 0.0ms P99: 0.1ms. Sample: 100
76+
let tick_stats_stripped = tick_stats.replace([':', ',', '(', ')', '.'], " ");
7677
let timings: Vec<_> = tick_stats_stripped
7778
.split_whitespace()
7879
.filter(|w| w.ends_with("ms"))

0 commit comments

Comments
 (0)