e6f1f63b8dce6d3cbf7b730ec200e361245eeef7
- Skip rows with null/malformed timestamps instead of silently re-stamping with time.Now() (data corruption hidden behind a fallback). Drops the time import. - Replace ad-hoc parentDir() with stdlib filepath.Dir(). - Add t.Fatal error checks to TestExtractRows_SkipsBadExtra (CREATE TABLE / INSERT) and switch sql.Open to checked form. - New TestExtractRows_SkipsBadTimestamp covers the null-ts path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
stats-gateway
gRPC service collecting and publishing HTTP/TCP/DNS/TLS-handshake timing metrics for two geo-distributed OpenSpeedTest nodes (FL — Finland, PL1 — Poland). Powers the dashboard at https://stats.projectshitpost.fun/.
Components
cmd/server— gRPC server (TLS terminated by nginx, listens on loopback).cmd/collector— periodic prober (HTTP HEAD with httptrace), runs every 5 min via systemd timer.cmd/snapshot— generatessnapshot.jsonfor the dashboard, runs every 10 min.internal/probes— timing logic (DNS, TCP, TLS handshake, HTTP).internal/storage— SQLite WAL with embedded migrations.internal/service— gRPC handlers (RecentResults,Aggregate,Tunnel).proto/— protobuf definitions; generated Go ingen/.stats-site/— static dashboard (vanilla JS + canvas charts, no framework deps).psp-stats-cli/— Go CLI for querying the API.systemd/— ops units for running the service + timers.docs/AUTH.md— auth doc for theTunnelmethod (Bearer JWT/HS256, used by internal CI agents).
Build
make build # ./bin/{stats-gateway,stats-collector,stats-snapshot}
make test
cd psp-stats-cli && make build
API
grpcurl -d '{"node":"fl","limit":5}' \
stats.projectshitpost.fun:443 stats.v1.SpeedStatus/RecentResults
See proto/stats.proto.
License
MIT — see LICENSE.
Languages
Go
78.1%
HTML
10.8%
JavaScript
5.9%
Shell
2.2%
CSS
2.1%
Other
0.9%