Skip to content

Commit

Permalink
mds: include session uptime when diplaying session list
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/35937
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit b23a204)
  • Loading branch information
vshankar committed Oct 4, 2018
1 parent a1927d0 commit a184abd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/mds/MDSRank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,7 @@ void MDSRankDispatcher::dump_sessions(const SessionFilter &filter, Formatter *f)
if (s->is_open() || s->is_stale()) {
f->dump_unsigned("request_load_avg", s->get_load_avg());
}
f->dump_float("uptime", s->get_session_uptime());
f->dump_int("replay_requests", is_clientreplay() ? s->get_request_count() : 0);
f->dump_unsigned("completed_requests", s->get_num_completed_requests());
f->dump_bool("reconnecting", server->waiting_for_reconnect(p->first.num()));
Expand Down
5 changes: 5 additions & 0 deletions src/mds/SessionMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ class Session : public RefCountedObject {
load_avg.hit(ceph_clock_now(), load_avg_rate);
}

double get_session_uptime() const {
chrono::duration<double> uptime = clock::now() - birth_time;
return uptime.count();
}

time get_birth_time() const {
return birth_time;
}
Expand Down

0 comments on commit a184abd

Please sign in to comment.