diff options
-rw-r--r-- | src/common/TrackedOp.cc | 12 | ||||
-rw-r--r-- | src/common/TrackedOp.h | 6 | ||||
-rw-r--r-- | src/osd/OpRequest.cc | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/src/common/TrackedOp.cc b/src/common/TrackedOp.cc index c9e9a061a49..4ed9f20d1fc 100644 --- a/src/common/TrackedOp.cc +++ b/src/common/TrackedOp.cc @@ -134,7 +134,7 @@ bool OpTracker::check_ops_in_flight(std::vector<string> &warning_vector) utime_t too_old = now; too_old -= cct->_conf->op_tracker_complaint_time; - utime_t oldest_secs = now - ops_in_flight.front()->received_time; + utime_t oldest_secs = now - ops_in_flight.front()->get_arrived(); dout(10) << "ops_in_flight.size: " << ops_in_flight.size() << "; oldest is " << oldest_secs @@ -148,11 +148,11 @@ bool OpTracker::check_ops_in_flight(std::vector<string> &warning_vector) int slow = 0; // total slow int warned = 0; // total logged - while (!i.end() && (*i)->received_time < too_old) { + while (!i.end() && (*i)->get_arrived() < too_old) { slow++; // exponential backoff of warning intervals - if (((*i)->received_time + + if (((*i)->get_arrived() + (cct->_conf->op_tracker_complaint_time * (*i)->warn_interval_multiplier)) < now) { // will warn @@ -162,9 +162,9 @@ bool OpTracker::check_ops_in_flight(std::vector<string> &warning_vector) if (warned > cct->_conf->op_tracker_log_threshold) break; - utime_t age = now - (*i)->received_time; + utime_t age = now - (*i)->get_arrived(); stringstream ss; - ss << "slow request " << age << " seconds old, received at " << (*i)->received_time + ss << "slow request " << age << " seconds old, received at " << (*i)->get_arrived() << ": " << *((*i)->request) << " currently " << ((*i)->current.size() ? (*i)->current : (*i)->state_string()); warning_vector.push_back(ss.str()); @@ -198,7 +198,7 @@ void OpTracker::get_age_ms_histogram(pow2_hist_t *h) uint32_t lb = 1 << (bin-1); // lower bound for this bin int count = 0; for (xlist<TrackedOp*>::iterator i = ops_in_flight.begin(); !i.end(); ++i) { - utime_t age = now - (*i)->received_time; + utime_t age = now - (*i)->get_arrived(); uint32_t ms = (long)(age * 1000.0); if (ms >= lb) { count++; diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 94eb4e3f71e..9007a4d5bd2 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -119,7 +119,6 @@ protected: list<pair<utime_t, string> > events; /// list of events and their times Mutex lock; /// to protect the events list - utime_t received_time; /// the time the triggering Message was received string current; /// the current state the event is in uint64_t seq; /// a unique value set by the OpTracker @@ -133,7 +132,6 @@ protected: seq(0), warn_interval_multiplier(1) { - received_time = request->get_recv_stamp(); tracker->register_inflight_op(&xitem); } @@ -143,12 +141,12 @@ public: virtual ~TrackedOp() { assert(request); request->put(); } utime_t get_arrived() const { - return received_time; + return request->get_recv_stamp(); } // This function maybe needs some work; assumes last event is completion time double get_duration() const { return events.size() ? - (events.rbegin()->first - received_time) : + (events.rbegin()->first - get_arrived()) : 0.0; } Message *get_req() const { return request; } diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index 30ff999719f..1c523585a8e 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -30,8 +30,8 @@ void OpRequest::dump(utime_t now, Formatter *f) const m->print(name); f->dump_string("description", name.str().c_str()); // this OpRequest f->dump_unsigned("rmw_flags", rmw_flags); - f->dump_stream("received_at") << received_time; - f->dump_float("age", now - received_time); + f->dump_stream("received_at") << get_arrived(); + f->dump_float("age", now - get_arrived()); f->dump_float("duration", get_duration()); f->dump_string("flag_point", state_string()); if (m->get_orig_source().is_client()) { |