mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[benchmark] Fix benchmark duration calculation logic (#4446)
* Fix benchmark duration calculation logic Calculate benchmark duration using filtered outputs. * Fix benchmark duration calculation using benchmark_outputs
This commit is contained in:
@@ -474,8 +474,8 @@ async def benchmark(
|
|||||||
benchmark_outputs = outputs[half : n - half]
|
benchmark_outputs = outputs[half : n - half]
|
||||||
|
|
||||||
# 根据收到最后一个chunk的时间戳计算总时长
|
# 根据收到最后一个chunk的时间戳计算总时长
|
||||||
if len(outputs) >= 2:
|
if len(benchmark_outputs) >= 2:
|
||||||
benchmark_duration = outputs[-1].end_timestamp - outputs[0].end_timestamp
|
benchmark_duration = benchmark_outputs[-1].end_timestamp - benchmark_outputs[0].end_timestamp
|
||||||
else:
|
else:
|
||||||
benchmark_duration = 0.0
|
benchmark_duration = 0.0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user