Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion astrbot/dashboard/routes/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ async def get_provider_token_stats(self):
total_by_umo: dict[str, int] = defaultdict(int)
total_by_bucket: dict[int, int] = defaultdict(int)
range_total_tokens = 0
range_total_output_tokens = 0
range_total_calls = 0
range_success_calls = 0
range_ttft_total_ms = 0.0
Expand Down Expand Up @@ -286,6 +287,7 @@ async def get_provider_token_stats(self):
record.end_time - record.start_time
) * 1000
range_duration_samples += 1
range_total_output_tokens += record.token_output

if created_at_local >= today_start_local:
today_total_calls += 1
Expand Down Expand Up @@ -371,7 +373,8 @@ async def get_provider_token_stats(self):
else 0
),
"range_avg_tpm": (
range_total_tokens / (range_duration_total_ms / 1000 / 60)
range_total_output_tokens
/ (range_duration_total_ms / 1000 / 60)
if range_duration_total_ms > 0
else 0
),
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/i18n/locales/en-US/features/stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"callCount": "{count} calls",
"avgTtft": "Average TTFT",
"avgDuration": "Average Response Time",
"avgTpm": "Average TPM",
"avgTpm": "Average Output TPM",
"successRate": "Success Rate"
},
"modelRanking": {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/i18n/locales/ru-RU/features/stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"callCount": "{count} вызовов",
"avgTtft": "Средний TTFT",
"avgDuration": "Среднее время ответа",
"avgTpm": "Средний TPM",
"avgTpm": "Средний Output TPM",
"successRate": "Доля успешных вызовов"
},
"modelRanking": {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/i18n/locales/zh-CN/features/stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"callCount": "共 {count} 次调用",
"avgTtft": "平均首字延迟(TTFT)",
"avgDuration": "平均响应时间",
"avgTpm": "平均每分钟词元数(TPM)",
"avgTpm": "平均每分钟输出(TPM)",
"successRate": "调用成功率"
},
"modelRanking": {
Expand Down
Loading