diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/api/handlers.go | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/internal/api/handlers.go b/internal/api/handlers.go index bdde394..2e0af1e 100644 --- a/internal/api/handlers.go +++ b/internal/api/handlers.go @@ -104,9 +104,9 @@ func InitializeAPI(logs *[LogLength]string, n *int, toLogParser chan string) { status.overallStatus = overallStatus{ Status: StatusOperational, Description: "Everything is operating normally", - Uptime: 50.0, - ResponseTime: 20000, - ActiveIncidents: 9001, + Uptime: 99.99, + ResponseTime: 75, + ActiveIncidents: 0, ScheduledMaintenance: 1, } @@ -131,11 +131,81 @@ func InitializeAPI(logs *[LogLength]string, n *int, toLogParser chan string) { Uptime: 99.999, }) + status.services = append(status.services, service{ + Id: ServiceWeb, + Name: "Web Application", + Description: "TaskFlow web interface", + Icon: IconWeb, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + + status.services = append(status.services, service{ + Id: ServiceAuth, + Name: "Authentication", + Description: "User authentication service", + Icon: IconAuth, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + + status.services = append(status.services, service{ + Id: ServiceDB, + Name: "Database", + Description: "Primary database cluster", + Icon: IconDB, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + + status.services = append(status.services, service{ + Id: ServiceStorage, + Name: "File Storage", + Description: "Document and file storage", + Icon: IconStorage, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + + status.services = append(status.services, service{ + Id: ServiceNotifications, + Name: "Notifications", + Description: "Email and push notifications", + Icon: IconNotifications, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + + status.services = append(status.services, service{ + Id: ServiceSearch, + Name: "Search Service", + Description: "Full-text search functionality", + Icon: IconSearch, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + + status.services = append(status.services, service{ + Id: ServiceAnalytics, + Name: "Analytics", + Description: "USage analytics and reporting", + Icon: IconAnalytics, + Status: StatusOperational, + ResponseTime: 69 + rand.Intn(14) - 7, + Uptime: 99.999, + }) + status.metrics = metrics{ Uptime: 90.5, ResponseTime: 169, RequestVolume: 5, - ErrorRate: 106.0, + ErrorRate: 0.1, } status.incidents = []incident{} |