mgrc(m->cct, m),
log_client(m->cct, messenger, &mc->monmap, LogClient::NO_FLAGS),
mds_rank(NULL),
- asok_hook(NULL)
+ asok_hook(NULL),
+ starttime(mono_clock::now())
{
orig_argc = 0;
orig_argv = NULL;
f->dump_unsigned("osdmap_epoch", 0);
f->dump_unsigned("osdmap_epoch_barrier", 0);
}
+
+ f->dump_float("uptime", get_uptime().count());
+
f->close_section(); // status
}
SafeTimer timer;
+
+ mono_time get_starttime() const {
+ return starttime;
+ }
+ chrono::duration<double> get_uptime() const {
+ mono_time now = mono_clock::now();
+ return chrono::duration<double>(now-starttime);
+ }
+
protected:
Beacon beacon;
void handle_command(class MCommand *m);
void handle_mds_map(class MMDSMap *m);
void _handle_mds_map(MDSMap *oldmap);
+
+private:
+ mono_time starttime = mono_clock::zero();
};
messenger(msgr), monc(monc_),
respawn_hook(respawn_hook_),
suicide_hook(suicide_hook_),
- standby_replaying(false)
+ standby_replaying(false),
+ starttime(mono_clock::now())
{
hb = g_ceph_context->get_heartbeat_map()->add_worker("MDSRank", pthread_self());
} else if (state == MDSMap::STATE_CLIENTREPLAY) {
dump_clientreplay_status(f);
}
+ f->dump_float("rank_uptime", get_uptime().count());
}
void MDSRank::dump_clientreplay_status(Formatter *f) const
// a separate lock here in future potentially.
Mutex &mds_lock;
+ mono_time get_starttime() const {
+ return starttime;
+ }
+ chrono::duration<double> get_uptime() const {
+ mono_time now = mono_clock::now();
+ return chrono::duration<double>(now-starttime);
+ }
+
class CephContext *cct;
bool is_daemon_stopping() const;
/* Update MDSMap export_targets for this rank. Called on ::tick(). */
void update_targets(utime_t now);
+
+private:
+ mono_time starttime = mono_clock::zero();
};
/* This expects to be given a reference which it is responsible for.