How should throughput be averaged across equal-sized jobs?
For equal amounts of work the combined rate is the harmonic mean, since time spent on each job is inversely proportional to its rate.
Python example and interpretation
Two hundred records split equally between rates of ten and thirty per second yield fifteen per second overall. Equal-duration runs require different weights.
from statistics import harmonic_mean
harmonic_mean([10,30])Result 15.0
中文
两段处理等量数据的任务怎样平均吞吐率?
对等量工作,合并吞吐量是速率的调和平均数,因为各段耗时与速率成反比。
Python 算例与适用条件
各处理一百条,速度为每秒 10 与 30 条,总体每秒 15 条。若两段是等时间而非等工作量,权重会不同。
from statistics import harmonic_mean
harmonic_mean([10,30])结果 15.0