feat(dashboard): Database usage task, API and settings

The database_usage task (hourly) measures on the background connection,
checks the free space on the database's disk (database_disk_path, else the
SQLite file or a local MySQL data directory) and alerts once when it drops
under database_disk_warn_percent. Log pruning keeps database_usage_days.
GET /api/database/usage?range=day|week|month. The settings are on the
Settings page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-02 17:57:31 -05:00
parent 58f8789255
commit f8134ac418
7 changed files with 192 additions and 0 deletions

View File

@@ -102,6 +102,7 @@
#include "master/ServerTraffic.h"
#include "master/Profiling.h"
#include "Performance.h"
#include "DatabaseUsage.h"
#include "Background.h"
#include "master/DashboardMessages.h"
#include "master/DataChanged.h"
@@ -543,6 +544,7 @@ int main(int argc, char** argv) {
UpdateChecker::Initialize();
Background::Initialize();
RegisterEconomyTasks();
DatabaseUsage::RegisterTask();
RegisterMaintenanceTasks();
RegisterBackupTask();
RegisterReportViewTask();
@@ -607,6 +609,7 @@ int main(int argc, char** argv) {
PrometheusMetrics::RegisterRoutes();
Traffic::RegisterRoutes();
Performance::RegisterRoutes();
DatabaseUsage::RegisterRoutes();
RegisterPublicRoutes();
RegisterShowcaseRoutes();
FeaturedProperties::RegisterRoutes();