Skip to content

dakotasnapshot/librespeed-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LibreSpeed Analytics

A premium analytics dashboard plugin for LibreSpeed. Replaces the basic stats.php with a full-featured, interactive reporting interface.

Screenshots

Dashboard Overview

Dashboard Overview Summary cards with sparklines, speed over time, latency tracking, and speed distribution.

ISP, Geographic, and Device Analysis

Charts Breakdown Top ISPs, tests by town/state, browser/OS distribution, and peak hours heatmap.

Detailed Results Table

Results Table Sortable, searchable, paginated table with CSV and JSON export.

Features

Summary Dashboard

  • Total tests, unique IPs, unique ISPs, average download/upload/ping
  • Sparkline trends in each stat card (last 30 days)
  • Time period selector: 24h, 7d, 30d, 90d, All Time, Custom date range

Charts

  • Speed Over Time — download and upload line chart with gradient fills
  • Latency Over Time — ping and jitter tracking
  • Speed Distribution — histogram buckets (0-25, 25-50, 50-100, 100-200, 200-500, 500+ Mbps)
  • Top ISPs — horizontal bar chart with average speeds per ISP
  • Geographic breakdown — tests by town and state with cached GeoIP enrichment
  • Browser and OS distribution — parsed from user agent strings
  • Peak Hours heatmap — day of week vs. hour of day

Data Table

  • Full sortable, searchable, paginated results table
  • Columns: ID, date, IP, ISP, town, state, country, download, upload, ping, jitter, browser
  • Per-page selector (25/50/100)

Export

  • CSV export
  • JSON export

Requirements

  • PHP 7.4+
  • SQLite3 PHP extension
  • LibreSpeed with telemetry enabled
  • Chart.js (loaded from CDN, no local install needed)

Installation

  1. Copy analytics.php to your LibreSpeed results/ directory:

    cp analytics.php /path/to/librespeed/results/analytics.php
    
  2. Make sure telemetry_settings.php exists in the same directory with your $stats_password set:

    <?php
    $db_type = "sqlite";
    $Sqlite_db_file = "/path/to/librespeed/results/telemetry.db";
    $stats_password = "your-password-here";
  3. Access the dashboard at:

    https://your-server/results/analytics.php
    

How It Works

  • Single PHP file — no build tools, no npm, no composer
  • Reads from the existing LibreSpeed telemetry SQLite database
  • Creates a local geoip_cache SQLite table for cached GeoIP enrichment
  • All charts rendered client-side with Chart.js
  • Data fetched via internal JSON API endpoints (?api=summary, ?api=timeseries, etc.)
  • Authentication uses the same $stats_password from telemetry_settings.php
  • Current GeoIP enrichment uses cached lookups against ip-api.com; for fully local production enrichment, GeoLite2 City is a strong next step

API Endpoints

All endpoints require authentication and accept period and optional start/end query parameters.

Endpoint Description
?api=summary Aggregate stats (counts, averages)
?api=sparkline Daily aggregates for last 30 days
?api=timeseries Raw speed/latency data points over time
?api=distribution Speed distribution buckets
?api=isp Top ISPs by test count with average speeds
?api=geo Tests by town, state, country, and ASN
?api=devices Browser and OS breakdown
?api=heatmap Tests by hour and day of week
?api=table Paginated, sortable, searchable results
?api=export&format=csv CSV download
?api=export&format=json JSON download

License

MIT

Author

Dakota Cole

About

Premium analytics dashboard plugin for LibreSpeed — beautiful, interactive charts and insights for your speed test data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages