Overview
The AppUptime model tracks the availability and performance of third-party applications. It stores time-series data for monitoring app health and response times.Schema Structure
Field Purposes
packageName (string)
Identifies which app this metric belongs to:- Links to App model via package name
- Enables per-app monitoring dashboards
- Used for alerting on specific apps
timestamp (Date)
When this measurement was taken:- Time-series data point
- Enables historical analysis
- Used for uptime percentage calculations
health (enum)
Overall app health status:- healthy: App responding normally
- degraded: Slow responses or partial failures
- offline: App not responding at all
onlineStatus (boolean)
Simple binary availability:- Quick dashboard indicators
- Uptime percentage calculations
- Triggering alerts
responseTimeMs (number | null)
Webhook response latency:- Performance monitoring
- SLA tracking
- Null when app is offline
Usage Patterns
Health Monitoring
Uptime Calculation
Performance Tracking
Data Collection
Uptime records are created by:- Periodic health checks: Every 5 minutes
- Webhook failures: When app doesn’t respond
- User reports: Manual health updates
Retention
- Keep high-resolution data for 7 days
- Aggregate to hourly for 30 days
- Monthly summaries retained indefinitely
Indexes
- packageName: Filter by app
- timestamp: Time-based queries
- Compound index on both for efficient queries