mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
Exclude unknown providers from usage aggregations
This commit is contained in:
@@ -163,12 +163,19 @@ pub(super) async fn build_admin_usage_aggregation_stats_response(
|
||||
"api_format" => UsageAuditAggregationGroupBy::ApiFormat,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let exclude_reserved_provider_labels = matches!(
|
||||
group_by_query,
|
||||
UsageAuditAggregationGroupBy::Model
|
||||
| UsageAuditAggregationGroupBy::Provider
|
||||
| UsageAuditAggregationGroupBy::ApiFormat
|
||||
);
|
||||
let usage = state
|
||||
.aggregate_usage_audits(&UsageAuditAggregationQuery {
|
||||
created_from_unix_secs,
|
||||
created_until_unix_secs,
|
||||
group_by: group_by_query,
|
||||
limit,
|
||||
exclude_reserved_provider_labels,
|
||||
})
|
||||
.await?;
|
||||
|
||||
|
||||
@@ -780,6 +780,7 @@ async fn dashboard_load_user_counts(
|
||||
created_until_unix_secs,
|
||||
group_by: UsageAuditAggregationGroupBy::User,
|
||||
limit: 10_000,
|
||||
exclude_reserved_provider_labels: false,
|
||||
})
|
||||
.await?;
|
||||
let count = fallback.len() as u64;
|
||||
|
||||
Reference in New Issue
Block a user