diff --git a/apps/metrics/20260130-000000/index.tsx b/apps/metrics/20260130-000000/index.tsx index 152dbcb..5bb33b2 100644 --- a/apps/metrics/20260130-000000/index.tsx +++ b/apps/metrics/20260130-000000/index.tsx @@ -13,6 +13,7 @@ const DATA_HISTORY_MAX_DAYS = 30 // Keep 30 days of data size history const SAMPLE_INTERVAL_MS = 10_000 // How often to sample process metrics const HISTORY_MAX_SAMPLES = 60 // Keep 10 minutes of history at 10s intervals +const APPS_DIR = process.env.APPS_DIR! const TOES_DIR = process.env.TOES_DIR! const TOES_URL = process.env.TOES_URL! @@ -178,9 +179,12 @@ setInterval(sampleAndRecordHistory, SAMPLE_INTERVAL_MS) // ============================================================================ function getDataSize(appName: string): number { + let total = 0 + const appDir = join(APPS_DIR, appName) + if (existsSync(appDir)) total += dirSize(appDir) const dataDir = join(TOES_DIR, appName) - if (!existsSync(dataDir)) return 0 - return dirSize(dataDir) + if (existsSync(dataDir)) total += dirSize(dataDir) + return total } function dirSize(dir: string): number {