fix: align dashboard charts with customer billing and history coverage

This commit is contained in:
elky
2026-10-09 21:53:43 +08:00
parent 63520c8c27
commit 6b6d5b3a85
19 changed files with 1561 additions and 153 deletions
@@ -196,6 +196,8 @@ impl UsageAnalyticsQuery {
#[serde(default)]
pub struct UsageAnalyticsMetrics {
pub request_count: u64,
// Populated for dashboard chart buckets; distinct counts are not additive.
pub unique_providers: Option<u64>,
pub successful_request_count: u64,
pub failed_request_count: u64,
pub cancelled_request_count: u64,
@@ -429,6 +431,7 @@ pub fn fill_usage_analytics_timeseries(
label: Some(start.clone()),
bucket_start: Some(start),
metrics: UsageAnalyticsMetrics {
unique_providers: Some(0),
rated_amount: Some("0.00000000".into()),
billable_amount: Some("0.00000000".into()),
..Default::default()