Skip to content

Commit 922ba79

Browse files
author
Max Verevkin
committed
fix speedtest
1 parent bb93867 commit 922ba79

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/blocks/speedtest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ impl Block for SpeedTest {
221221
if self.config.bytes { "B/s" } else { "b/s" },
222222
));
223223

224-
// ping is in milliseconds
225-
self.text[0].set_state(match ping as i32 {
226-
0..=25_000 => State::Good,
227-
25_001..=60_000 => State::Info,
228-
60_001..=100_000 => State::Warning,
224+
// ping is in seconds
225+
self.text[0].set_state(match (ping * 1000.) as i32 {
226+
0..=25 => State::Good,
227+
26..=60 => State::Info,
228+
61..=100 => State::Warning,
229229
_ => State::Critical,
230230
});
231231
}

0 commit comments

Comments
 (0)