minor modification to benchmark (#100)
Co-authored-by: hanjun <hanjun@agibot.com>
This commit is contained in:
parent
b9d861c327
commit
d4eefad587
@ -175,7 +175,7 @@ void BenchmarkSubscriberModule::Evaluate() const {
|
||||
|
||||
size_t recv_count = statistics_array.size();
|
||||
|
||||
double loss_rate = static_cast<double>(send_count - recv_count) / send_count;
|
||||
double loss_rate = static_cast<double>(send_count - recv_count) / send_count * 100.0;
|
||||
|
||||
std::sort(statistics_array.begin(), statistics_array.end());
|
||||
|
||||
@ -195,7 +195,7 @@ msg size: {} bytes
|
||||
msg count per topic: {}
|
||||
send count : {}
|
||||
recv count: {}
|
||||
loss rate: {}
|
||||
loss rate: {} %
|
||||
min latency: {} us
|
||||
max latency: {} us
|
||||
avg latency: {} us
|
||||
|
@ -232,7 +232,7 @@ co::Task<void> BenchmarkRpcClientModule::StartSinglePlan(uint32_t plan_id, Bench
|
||||
uint64_t correct_count = gather_vec.size();
|
||||
uint64_t total_count = plan.msg_count * plan.parallel;
|
||||
|
||||
double error_rate = static_cast<double>(total_count - correct_count) / total_count;
|
||||
double error_rate = static_cast<double>(total_count - correct_count) / total_count * 100;
|
||||
double qps = (total_count * 1000.0) / total_time_ms;
|
||||
|
||||
std::sort(gather_vec.begin(), gather_vec.end());
|
||||
|
@ -168,7 +168,7 @@ class BenchmarkSubscriber(aimrt_py.ModuleBase):
|
||||
result_str += f"\nmsg count per topic: {self.cur_bench_plan.send_num}"
|
||||
result_str += f"\nsend count: {send_count}"
|
||||
result_str += f"\nrecv count: {recv_count}"
|
||||
result_str += f"\nloss rate: {loss_rate:.2f}"
|
||||
result_str += f"\nloss rate: {loss_rate:.2f} % "
|
||||
result_str += f"\nmin latency: {min_latency:.3f} us"
|
||||
result_str += f"\nmax latency: {max_latency:.3f} us"
|
||||
result_str += f"\navg latency: {avg_latency:.3f} us"
|
||||
|
@ -168,7 +168,7 @@ class BenchmarkRpcClientModule(aimrt_py.ModuleBase):
|
||||
|
||||
correct_count = len(self.perf_data)
|
||||
total_count = plan['parallel'] * plan['msg_count']
|
||||
error_rate = (total_count - correct_count) / total_count
|
||||
error_rate = (total_count - correct_count) / total_count * 100.0
|
||||
qps = (total_count * 1000.0) / total_time_ms
|
||||
|
||||
min_latency = self.perf_data[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user