test(usage): add unit tests for account_cost and fix gofmt
- Fix mock for GetModelStatsWithFilters: add account_cost column - Add assertion: GetStatsWithFilters always returns TotalAccountCost - New test: GetModelStatsAccountCostColumn verifies scan of AccountCost - New test: GetGroupStatsAccountCostColumn verifies scan of AccountCost - New test: GetStatsWithFiltersAlwaysReturnsAccountCost (no AccountID filter) - Integration test: add TotalAccountCost/TodayAccountCost assertions - Fix gofmt alignment in usage_log_types.go
This commit is contained in:
@@ -67,9 +67,9 @@ type DashboardStats struct {
|
||||
TodayCacheCreationTokens int64 `json:"today_cache_creation_tokens"`
|
||||
TodayCacheReadTokens int64 `json:"today_cache_read_tokens"`
|
||||
TodayTokens int64 `json:"today_tokens"`
|
||||
TodayCost float64 `json:"today_cost"` // 今日标准计费
|
||||
TodayActualCost float64 `json:"today_actual_cost"` // 今日实际扣除
|
||||
TodayAccountCost float64 `json:"today_account_cost"` // 今日账号成本
|
||||
TodayCost float64 `json:"today_cost"` // 今日标准计费
|
||||
TodayActualCost float64 `json:"today_actual_cost"` // 今日实际扣除
|
||||
TodayAccountCost float64 `json:"today_account_cost"` // 今日账号成本
|
||||
|
||||
// 系统运行统计
|
||||
AverageDurationMs float64 `json:"average_duration_ms"` // 平均响应时间
|
||||
|
||||
Reference in New Issue
Block a user