using EonaCat.Json; namespace EonaCat.DoxaApi.Models { // This file is part of the EonaCat project(s) which is released under the Apache License. // See the LICENSE file or go to https://EonaCat.com/license for full license details. /// /// Analytics dashboard data containing metrics and insights. /// public class AnalyticsDashboard { [JsonProperty("totalEndpoints")] public int TotalEndpoints { get; set; } [JsonProperty("totalRequests")] public int TotalRequests { get; set; } [JsonProperty("totalErrors")] public int TotalErrors { get; set; } [JsonProperty("averageResponseTime")] public double AverageResponseTime { get; set; } [JsonProperty("peakRequestsPerSecond")] public double PeakRequestsPerSecond { get; set; } [JsonProperty("uptime")] public TimeSpan Uptime { get; set; } [JsonProperty("topEndpoints")] public List TopEndpoints { get; set; } = new(); [JsonProperty("recentRequests")] public List RecentRequests { get; set; } = new(); [JsonProperty("errorRate")] public double ErrorRate { get; set; } [JsonProperty("generatedAt")] public DateTime GeneratedAt { get; set; } = DateTime.UtcNow; } /// /// Summary of endpoint usage for dashboard display. /// public class EndpointUsageSummary { [JsonProperty("method")] public string Method { get; set; } = string.Empty; [JsonProperty("path")] public string Path { get; set; } = string.Empty; [JsonProperty("requestCount")] public int RequestCount { get; set; } [JsonProperty("errorCount")] public int ErrorCount { get; set; } [JsonProperty("averageResponseTimeMs")] public double AverageResponseTimeMs { get; set; } [JsonProperty("lastCalled")] public DateTime? LastCalled { get; set; } } }