mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-01 18:20:16 +08:00
Compare commits
2 Commits
codex/rest
...
fix/tpm-ou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a88e0adc63 | ||
|
|
260d38a83b |
@@ -243,6 +243,7 @@ class StatRoute(Route):
|
||||
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
|
||||
@@ -286,6 +287,7 @@ class StatRoute(Route):
|
||||
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
|
||||
@@ -371,7 +373,8 @@ class StatRoute(Route):
|
||||
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
|
||||
),
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
"callCount": "{count} вызовов",
|
||||
"avgTtft": "Средний TTFT",
|
||||
"avgDuration": "Среднее время ответа",
|
||||
"avgTpm": "Средний TPM",
|
||||
"avgTpm": "Средний Output TPM",
|
||||
"successRate": "Доля успешных вызовов"
|
||||
},
|
||||
"modelRanking": {
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
"callCount": "共 {count} 次调用",
|
||||
"avgTtft": "平均首字延迟(TTFT)",
|
||||
"avgDuration": "平均响应时间",
|
||||
"avgTpm": "平均每分钟词元数(TPM)",
|
||||
"avgTpm": "平均每分钟输出(TPM)",
|
||||
"successRate": "调用成功率"
|
||||
},
|
||||
"modelRanking": {
|
||||
|
||||
Reference in New Issue
Block a user