-
Notifications
You must be signed in to change notification settings - Fork 4
Home
A simple web server(and library) to display server stats over HTTP and Websockets/SSE or stream it to other systems. x-server(in x-server-stats) is not to be confused with X Window System.
read
$ cargo install x-server-stats
You need to export below environment variables to run the server.
The environment variables prefixed with PG
are for PotsgreSQL database. Currently, only PostgreSQL is supported for storing stats.
export SERVER_ADDR=localhost:8082
export PG__USER=PG_USERNAME
export PG__PASSWORD=PG_PASSWORD
export PG__HOST=PG_HOST_URL
export PG__PORT=5432
export PG__DBNAME=PG_DB_NAME
export PG__POOL__MAX_SIZE=20
export BASE_ADDR=http://localhost:8082
Before running the application, you need to build it. You can do this by running the following command:
$ cargo build --release
Run the binary with the following command:
$ ./target/release/x-server-stats
You can run the application directly by running the following command:
$ cargo run --release
x-server-stats uses actix-governor to throttle incoming requests based on IP address.
The config is present at src/main.rs
and can be changed accordingly.
Throttling is important if you don't want to overwhelm the server with too many requests by internal systems.
We plan to make this configurable in the future, so you don't have to build from source to change the config.