From cf022fd90ade197226fbc47fd270121ee9bc9e4a Mon Sep 17 00:00:00 2001 From: Mingxin Liu Date: Wed, 22 Mar 2017 17:07:37 +0800 Subject: [PATCH] mon: quick start if no update in a long period Signed-off-by: Mingxin Liu --- src/mon/PGMap.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 8b4a1010ab26..b0a0523c600d 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1514,7 +1514,11 @@ void PGMap::update_delta(CephContext *cct, delta_t -= *last_ts; // take the last timestamp we saw *last_ts = ts; // @p ts becomes the last timestamp we saw - // calculate a delta, and average over the last 2 deltas. + // adjust delta_t, quick start if there is no update in a long period + delta_t = std::min(delta_t, + utime_t(2 * (cct ? cct->_conf->mon_delta_reset_interval : 10), 0)); + + // calculate a delta, and average over the last 6 deltas by default. /* start by taking a copy of our current @p result_pool_sum, and by * taking out the stats from @p old_pool_sum. This generates a stats * delta. Stash this stats delta in @p delta_avg_list, along with the -- 2.47.3