feat(stats): 添加 Provider 性能统计分析

This commit is contained in:
Entropy.Xu
2026-05-05 11:24:16 +08:00
parent 627eb4f335
commit ff1ed8b57d
17 changed files with 1683 additions and 22 deletions

View File

@@ -251,6 +251,16 @@ impl AppState {
.map_err(|err| GatewayError::Internal(err.to_string()))
}
pub(crate) async fn summarize_usage_provider_performance(
&self,
query: &usage::UsageProviderPerformanceQuery,
) -> Result<usage::StoredUsageProviderPerformance, GatewayError> {
self.data
.summarize_usage_provider_performance(query)
.await
.map_err(|err| GatewayError::Internal(err.to_string()))
}
pub(crate) async fn summarize_usage_cost_savings(
&self,
query: &usage::UsageCostSavingsSummaryQuery,