Crate speedtest_statuspage

Source
Expand description

§speedtest-statuspage

A utility application to serve speedtest results over an HTTP endpoint.

§Disclaimer

This project is not affiliated with, endorsed by, or sponsored by Ookla. (Ookla®). All trademarks and copyrights belong to their respective owners.

Re-exports§

pub use models::*;

Modules§

models
speedtest-statuspage

Structs§

RealSpeedtestRunner
Real speedtest runner implementation using the speedtest-cli binary.
speedtest
HTTP GET endpoint /speed returns the last cached speedtest result as JSON.

Statics§

LAST_RESULT
Global cached speedtest result and the instant it was cached.

Traits§

SpeedtestRunner
Trait to abstract running the speedtest command.

Functions§

clear_last_result_for_test
Clears the cached speedtest result.
get_cached_speedtest_result
Async function to get the cached speedtest result or return an error if not available.
get_last_result
Retrieves the last cached speedtest result, if available.
min_frequency_duration
Reads the environment variable INTERVAL_MINUTES or returns a default of 10 minutes.
run_speedtest_and_cache_with_runner
Runs the speedtest using the provided runner, parses the JSON output, and caches the result.
set_last_result_for_test
Sets the cached speedtest result. Used for testing purposes.
spawn_speedtest_scheduler
Background async task which schedules periodic speedtest runs.