Get debug file statistics
GET /api/system/debug/stats
Get comprehensive statistics about debug files.
Analyzes all debug files in the logs directory and provides detailed statistics including file counts, sizes, age analysis, and categorization by file type (crashdata vs dumplog).
Returns:
total_files: Total number of debug files foundtotal_size_mb: Total disk space used by debug files in megabytescrashdata_files: Count of crashdata-* filesdumplog_files: Count of dumplog-* filesoldest_file: ISO timestamp of the oldest debug file (or null)newest_file: ISO timestamp of the newest debug file (or null)files_older_than_week: Count of files older than 7 days
File Type Categories:
- crashdata-*: Crash dump data files with full error context
- dumplog-*: Dump log files with system state information
- .dump: Generic dump files
- .crash: Generic crash files
Age Analysis:
- Parses timestamps from filenames for accurate age tracking
- Falls back to file modification time if timestamp parsing fails
- Identifies files older than 7 days for cleanup recommendations
Raises:
- HTTPException (500): If statistics collection fails
Example Response:
{
"total_files": 42,
"total_size_mb": 125.67,
"crashdata_files": 28,
"dumplog_files": 14,
"oldest_file": "2024-12-11T10:30:00Z",
"newest_file": "2024-12-18T15:45:00Z",
"files_older_than_week": 15
}Responses
Section titled “ Responses ”Successful Response
Debug file statistics response.
Provides comprehensive debug file statistics including total file counts, total size, crash dump counts, old file counts, and file age information. Used by debug file management endpoints to report debug file inventory.
Fields:
total_files: Total number of debug files (required, integer)total_size_mb: Total size of all debug files in megabytes (required, float)crash_dumps: Number of crash dump files (required, integer)old_files: Number of files older than retention period (required, integer)oldest_file: Filename of oldest debug file (optional)newest_file: Filename of newest debug file (optional)
Usage: GET /api/debug/stats returns this response model with debug file statistics for cleanup planning and monitoring.
JSON Example:
{
"totalFiles": 25,
"totalSizeMb": 150.5,
"crashDumps": 15,
"oldFiles": 10,
"oldestFile": "crashdata-2024-12-01T10-30-00-000Z.json",
"newestFile": "crashdata-2025-01-31T10-30-00-000Z.json"
}object
Total number of debug files
Total size in MB
Number of crash dump files
Number of old files