Add alarm in callback streaming test

There aren't the right set of alarms in callback streaming reactor, so it exceeds the attempted qps while testing the fixed load streaming scenarios in synthetic benchmarks.
pull/18858/head
nanahpang 6 years ago committed by GitHub
parent defcbda8b2
commit 2d37a7a9b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      test/cpp/qps/client_callback.cc

@ -285,8 +285,18 @@ class CallbackStreamingPingPongReactor final
}
return;
}
write_time_ = UsageTimer::Now();
StartWrite(client_->request());
if (!client_->IsClosedLoop()) {
gpr_timespec next_issue_time = client_->NextRPCIssueTime();
// Start an alarm callback to run the internal callback after
// next_issue_time
ctx_->alarm_.experimental().Set(next_issue_time, [this](bool ok) {
write_time_ = UsageTimer::Now();
StartWrite(client_->request());
});
} else {
write_time_ = UsageTimer::Now();
StartWrite(client_->request());
}
}
void OnDone(const Status& s) override {

Loading…
Cancel
Save