Skip to content

Commit

Permalink
minor modification to benchmark (AimRT#100)
Browse files Browse the repository at this point in the history
Co-authored-by: hanjun <hanjun@agibot.com>
  • Loading branch information
owny990312 and hanjun authored Nov 14, 2024
1 parent b9d861c commit d4eefad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def Evaluate(self) -> None:
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def StartSinglePlan(self, plan_id: int, plan: dict) -> None:

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]
Expand Down

0 comments on commit d4eefad

Please sign in to comment.