namespace PrivaPub.ClientModels.Admin { // /clientapi/admin/statistics/overview: the last days' federation at a glance; counters keyed as the ledger keys them public class ViewStatisticsOverview { public int Days { get; set; } public Dictionary Channels { get; set; } = new(); public Dictionary Inbound { get; set; } = new(); public Dictionary Outbound { get; set; } = new(); public double? DeliverySuccess { get; set; } public ViewLatency DeliveryLatencyMs { get; set; } = new(); public ViewHostCounts Hosts { get; set; } = new(); public int Accounts { get; set; } public ViewLedgerCounts Ledger { get; set; } = new(); public ViewMediaTotals Media { get; set; } = new(); } // what media take on the server: the uploads and pictures kept, the remote media cache, the trash waiting its grace public class ViewMediaTotals { public long MediaBytes { get; set; } public long MediaFiles { get; set; } public long ProxyCacheBytes { get; set; } public long TrashBytes { get; set; } } public class ViewLatency { public int? P50 { get; set; } public int? P95 { get; set; } } public class ViewHostCounts { public int Active { get; set; } public long Known { get; set; } } public class ViewLedgerCounts { public long Written { get; set; } public long Dropped { get; set; } public long Failed { get; set; } } // /clientapi/admin/statistics/hosts: one page of the servers we exchanged with public class ViewHostsPage { public int Total { get; set; } public int Page { get; set; } public List Hosts { get; set; } = new(); public string Attribution { get; set; } } public class ViewHostRow { public string Host { get; set; } public string Software { get; set; } public string Version { get; set; } public long In { get; set; } public long Out { get; set; } public long Refused { get; set; } public long Failures { get; set; } public int? LatencyP50 { get; set; } public int Accounts { get; set; } public DateTime? DescribedAt { get; set; } public ViewHostDelivery Delivery { get; set; } } public class ViewHostDelivery { public int ConsecutiveFailures { get; set; } public DateTime? UnavailableUntil { get; set; } public DateTime? LastSuccessAt { get; set; } public DateTime? LastFailureAt { get; set; } } // /clientapi/admin/statistics/crawler: how far the crawler got public class ViewCrawler { public bool Enabled { get; set; } public long Touched { get; set; } public long Crawled { get; set; } public long Due { get; set; } public long RobotsDisallowed { get; set; } public List Recent { get; set; } = new(); } public class ViewCrawledHost { public string Host { get; set; } public string Seen { get; set; } public DateTime? LastCrawledAt { get; set; } public int? PeersCount { get; set; } public bool? RobotsDisallowed { get; set; } public string CrawlError { get; set; } public string Software { get; set; } } }