mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix(dashboard): 修复仪表盘与明细统计数值不一致并重建 cost_savings 聚合
- 统一 dashboard 聚合与 raw 查询的 token 计算,拆分今日节省和周期节省 - cache savings 改用 input price 估算未命中成本,修复历史 cost_savings 偏高 - raw 查询 total_tokens 改用 effective_input + output + cache_creation + cache_read 公式 - 新增独立 backfill 重建历史 cost_savings 聚合表,保留已发布 backfill 不变
This commit is contained in:
@@ -1429,7 +1429,7 @@ pub fn build_admin_stats_cost_savings_response(
|
||||
let mut estimated_full_cost: f64 = usage
|
||||
.iter()
|
||||
.map(|item| {
|
||||
item.settlement_output_price_per_1m().unwrap_or(0.0)
|
||||
item.settlement_input_price_per_1m().unwrap_or(0.0)
|
||||
* item.cache_read_input_tokens as f64
|
||||
/ 1_000_000.0
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user