Skip to main content

ringserverstats

Parse ringserver reports, compute statistics and store in influxdb.

ringserver activity

ringserver statistics by day

ringserver statistics by month

Installation

ringserverstats is distributed on PyPI https://pypi.org as a universal wheel.

    $ pip install ringserverstats

Postgresql preparation

CREATE ROLE resifstats WITH LOGIN PASSWORD 'md5xxxxxxxxxx';
CRATE DATABASE resifstats OWNER resifstats;
\c resifstats
CREATE EXTENSION timescaledb

Then go for the migrations :

$ yoyo apply --database postgresql://resifstats@resif-pgdev.u-ga.fr:5433/resifstats -m migrations

Docker

docker build -t ringserverstats:latest
docker run --rm -p 8000:8000 -e DATABASE_URI=postgresql://resifstats@resif-pgdev.u-ga.fr:5433/resifstats ringserverstats:latest

Usage

To work properly, this program needs the environment variable DATABASE_URI pointing to a valip postgresql URI

Command line interface

$ pip install --user ringserverstats
$ ringserverstats txlogs.log

Web application

For development :

cd webapp
FLASK_ENV=development FLASK_APP=webapp.py flask run

In production, use with gunicorn :

pip install gunicorn
cd ringserverstats
gunicorn -b 0.0.0.0:8000 webapp

To send date :

http localhost:8000 < txlogs.log
wget --post-file txlogs.log localhost:8000

Explanations

The TX logs from ringserver are metrics suitable for a timeserie database. The idea is to parse the logs, as in the exemple below, and to generate values to insert into an influxdb timeseries database.

The file grafana-dashboard.json can be imported into grafana to visualize this timeserie.

Events

The ringserverevents measure has several tags :

  • network, station, location, channel : which data was requested
  • geohash : location of the client in geohash format
  • hosthash : a hash of the client ip (usefull to correlate the clients requests)
  • city : an english city name

Grouping and downsampling

To achieve downsampling, we use timescaledb's continuous query.

License

ringserverstats is distributed under the terms of the GPL v3 or later. See LICENSE file.

Build

python3 setup.py sdist bdist_wheel

Test

tox

Metadata

Release files for ringserverstats 0.17.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ringserverstats 0.17.4
File Size Uploaded Provenance Actions
ringserverstats-0.17.4.tar.gz 17.9 kB Without provenance Details for ringserverstats-0.17.4.tar.gz

Release files / ringserverstats-0.17.4.tar.gz

Download URL ringserverstats-0.17.4.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1d0f413de78cb4704c90a3e14604a83329233681ce3f04ffd8e57d776bcd5d7c
BLAKE2b-256 checksum
How to use checksums
ab513fb387c065fcd7c2dfcbfe0cf68acbb0f5eb612248aaa9173507b16dcd85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.5

Security for ringserverstats 0.17.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.17.4 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page