Repository: modelscope/evalscope
Issue: 性能测试报告 “Average time per output token (s) ”计算逻辑有误，分母用的是sse chunk数不是真实的completion_tokens
Root cause: Algorithmic Error

## 自查清单

在提交 issue 之前，请确保您已完成以下步骤:
- [V] 我已仔细阅读了[相关使用说明文档](https://evalscope.readthedocs.io/zh-cn/latest/get_started/parameters.html)
- [V] 我已查看了[常见问题解答](https://evalscope.readthedocs.io/zh-cn/latest/get_started/faq.html)
- [V] 我已搜索并查看了现有的 issues，确认这不是一个重复的问题

## 问题描述

在性能测试工具中会计算 Average time per output token (s)和TPOT (s)分位数
但是Average time per output token (s)的计算逻辑分母是用的sse chunk数，在一个chunk包含多个输出token情况下有误
TPOT (s)的计算分母是completion_tokens

## EvalScope 版本（必填）
v 0.16.3

## 使用的工具
- [ ] Native / 原生框架
- [ ] Opencompass backend
- [ ] VLMEvalKit backend
- [ ] RAGEval backend
- [ V] Perf / 模型推理压测工具
- [ ] Arena / 竞技场模式

## 执行的代码或指令

evalscope perf   --parallel 64  --number 200  --model ***   --url https://****v1/chat/completions   --max-tokens 1000   --api openai   --dataset longalpaca   --api-key ****   --name '****'   --swanlab-api-key local   --dataset-path ****.json

## 错误日志

Benchmarking summary:
+-----------------------------------+-----------+
| Key                               |     Value |
+===================================+===========+
| Time taken for tests (s)          |  119.935  |
+-----------------------------------+-----------+
| Number of concurrency             |   64      |
+-----------------------------------+-----------+
| Total requests                    |  200      |
+-----------------------------------+-----------+
| Succeed requests                  |  200      |
+-----------------------------------+-----------+
| Failed requests                   |    0      |
+-----------------------------------+-----------+
| Output token throughput (tok/s)   | 1600.69   |
+-----------------------------------+-----------+
| Total token throughput (tok/s)    | 1777.21   |
+-----------------------------------+-----------+
| Request throughput (req/s)        |    1.6676 |
+-----------------------------------+-----------+
| Average latency (s)               |   31.1235 |
+-----------------------------------+-----------+
| Average time to first token (s)   |    1.346  |
+-----------------------------------+-----------+
| Average time per output token (s) |    0.0555 |
+-----------------------------------+-----------+
| Average input tokens per request  |  105.855  |
+-----------------------------------+-----------+
| Average output tokens per request |  959.895  |
+-----------------------------------+-----------+
| Average package latency (s)       |    0.0555 |
+-----------------------------------+-----------+
| Average package per request       |  536.76   |
+-----------------------------------+-----------+
2025-08-15 18:28:43,648 - evalscope - INFO - 
Percentile results:
+-------------+----------+---------+----------+-------------+--------------+---------------+----------------+---------------+
| Percentiles | TTFT (s) | ITL (s) | TPOT (s) | Latency (s) | Input tokens | Output tokens | Output (tok/s) | Total (tok/s) |
+-------------+----------+---------+----------+-------------+--------------+---------------+----------------+---------------+
|     10%     |  0.725   | 0.0458  |  0.0299  |   27.9857   |     105      |      872      |    29.7322     |    32.941     |
|     25%     |  0.8319  | 0.0506  |  0.0304  |   31.1722   |     105      |     1000      |     30.217     |    33.5833    |
|     50%     |  1.0238  | 0.0552  |  0.031   |   32.1441   |     106      |     1000      |    30.8339     |    34.2635    |
|     66%     |  1.3786  | 0.0578  |  0.0314  |   32.6021   |     106      |     1000      |    31.3083     |    34.7364    |
|     75%     |  1.8121  | 0.0597  |  0.0316  |   32.8489   |     106      |     1000      |     31.568     |    35.0651    |
|     80%     |  2.1476  | 0.0609  |  0.0317  |   32.9929   |     107      |     1001      |     31.69      |    35.2282    |
|     90%     |  2.5382  | 0.0643  |  0.0322  |   33.4809   |     107      |     1001      |    32.0799     |    35.681     |
|     95%     |  2.6947  | 0.0678  |  0.0326  |   34.1856   |     107      |     1001      |    32.2644     |    36.1172    |
|     98%     |  2.8251  | 0.0755  |  0.0331  |   34.3851   |     107      |     1001      |    32.5822     |    36.6528    |
|     99%     |  2.8631  |  0.14   |  0.0335  |   34.6203   |     107      |     1001      |    32.6513     |    41.6209    |
+-------------+----------+---------+----------+-------------+--------------+---------------+----------------+---------------+

## 运行环境

- 操作系统：Mac OS
- Python版本：3.12

## 其他信息

如果有其他相关信息，请在此处提供。


请使用最新版的evalscope，该问题已修复

> 感谢你的反馈！我们将关闭此问题。如果您有任何疑问，请随时重新打开它。如果EvalScope对您有所帮助，欢迎给我们点个STAR以示支持，谢谢！