Line speed: For developers
How Line speed is built, for anyone who wants to change it or make one like it. It is MIT, by TheMightyTRexUK, and works with plug-in API >=1.14 <2.0.
Its files
Containers
| Container | Network | Folders | Runs as | Starts | Limits |
|---|---|---|---|---|---|
main |
lan |
data |
10001:10001 |
always |
64 MB, 0.25 core |
Each image is pinned by digest in the manifest:
main:ghcr.io/themightytrex/starboard-plugin-examples@sha256:83b980f1828cdee537bcdf03702ddf6458710cba53f9009938225df430d34d9e
What Starboard calls
| Path | What it is |
|---|---|
GET /health |
Health: 200 while it can work |
GET /card |
The Line speed card (stat) |
GET /week |
The Line speed this week card (list) |
POST /test |
The Test now button |
POST /update/before |
The update's before step, 60 seconds at most |
POST /update/after |
The update's after step, 10 seconds at most |
How it works
app.pyuses only Python's standard library and the shared helpersbplugin.py.- A background job checks every 10 minutes (
every(600, nightly)) and tests once in the hour from Test at when there is no result for that day. - A test downloads Test size from
https://speed.cloudflare.com/__down, with a 120 second time limit, and works out Mbps from the time it took. - Results go in
runs.jsonin itsdatafolder, the newest 14. A failed background test is kept byevery()and shown on the Line speed card until there is a result. - Both cards answer with
band():okwith the newest test's time, orscheduled, with "Next test at" and the hour in the card. - It answers
POST /update/beforeandPOST /update/afterfromsbplugin.py, so an update waits for a test that is running.
Find out more
This page on GitHub, where the help is written.