aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/transport/bdp_estimator.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-10-18 14:47:18 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-10-18 14:47:18 -0700
commitd3d709a10fe2d3d9c2f2115bd4adad33e5a1ad0c (patch)
tree4a72ee6263f95fc39db944aab3699bc9f15922b8 /src/core/lib/transport/bdp_estimator.cc
parentcdaf6d8e0660f83b708e4e73e90a4deaeab7ea2b (diff)
parentdcd7e80fdaf29b3fd081e7ac9df708d4c562eb79 (diff)
Merge github.com:grpc/grpc into tracer
Diffstat (limited to 'src/core/lib/transport/bdp_estimator.cc')
-rw-r--r--src/core/lib/transport/bdp_estimator.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc
index 6eb2f54864..36826f45ca 100644
--- a/src/core/lib/transport/bdp_estimator.cc
+++ b/src/core/lib/transport/bdp_estimator.cc
@@ -32,13 +32,12 @@ BdpEstimator::BdpEstimator(const char *name)
accumulator_(0),
estimate_(65536),
ping_start_time_(gpr_time_0(GPR_CLOCK_MONOTONIC)),
- next_ping_scheduled_(0),
inter_ping_delay_(100.0), // start at 100ms
stable_estimate_count_(0),
bw_est_(0),
name_(name) {}
-void BdpEstimator::CompletePing(grpc_exec_ctx *exec_ctx) {
+grpc_millis BdpEstimator::CompletePing(grpc_exec_ctx *exec_ctx) {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
gpr_timespec dt_ts = gpr_time_sub(now, ping_start_time_);
double dt = (double)dt_ts.tv_sec + 1e-9 * (double)dt_ts.tv_nsec;
@@ -78,7 +77,7 @@ void BdpEstimator::CompletePing(grpc_exec_ctx *exec_ctx) {
}
ping_state_ = PingState::UNSCHEDULED;
accumulator_ = 0;
- next_ping_scheduled_ = grpc_exec_ctx_now(exec_ctx) + inter_ping_delay_;
+ return grpc_exec_ctx_now(exec_ctx) + inter_ping_delay_;
}
} // namespace grpc_core