diff options
| author | Agando <roduccomm@gmail.com> | 2026-07-29 20:46:12 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-07-29 20:46:12 +0200 |
| commit | 0003ad95fa091353827198d0a45cd63a3784479f (patch) | |
| tree | 4ea79302c13f34b2f1b84a56ed33cc149cd99a21 /api/debug/health.php | |
| parent | cf7461ffeb4f53f3f50c9c692a2e4fdcecf17e82 (diff) | |
auto: 2026-07-29_20:50 changes — gunes sponsorluk page, bunq payment modal, AI platforms, news W30
Diffstat (limited to 'api/debug/health.php')
| -rw-r--r-- | api/debug/health.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/api/debug/health.php b/api/debug/health.php new file mode 100644 index 0000000..5a0048f --- /dev/null +++ b/api/debug/health.php @@ -0,0 +1,20 @@ +<?php +require_once __DIR__ . '/config.php'; + +$errors = load_json(ERRORS_FILE); +$sessions = load_json(SESSIONS_FILE); + +$lastError = !empty($errors) ? end($errors) : null; + +json_response([ + 'success' => true, + 'status' => 'ok', + 'uptime' => filemtime(__FILE__) ? (time() - filemtime(__FILE__)) : 0, + 'total_errors' => count($errors), + 'total_sessions' => count($sessions), + 'errors_file_size_kb' => file_exists(ERRORS_FILE) ? round(filesize(ERRORS_FILE) / 1024, 1) : 0, + 'sessions_file_size_kb' => file_exists(SESSIONS_FILE) ? round(filesize(SESSIONS_FILE) / 1024, 1) : 0, + 'last_ingest' => $lastError ? ($lastError['ingested_at'] ?? null) : null, + 'last_ingest_message' => $lastError ? substr($lastError['message'] ?? '', 0, 100) : null, + 'generated_at' => date('c'), +]); |