summaryrefslogtreecommitdiffstats
path: root/src/mds/Beacon.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/Beacon.cc')
-rw-r--r--src/mds/Beacon.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc
index 6fbfc79d416..1c1eeb4ecf8 100644
--- a/src/mds/Beacon.cc
+++ b/src/mds/Beacon.cc
@@ -26,6 +26,7 @@
#include "mds/MDSRank.h"
#include "mds/MDSMap.h"
#include "mds/Locker.h"
+#include "mds/mdstypes.h"
#include "Beacon.h"
@@ -550,6 +551,19 @@ void Beacon::notify_health(MDSRank const *mds)
}
}
}
+ if (mds->is_replay()) {
+ CachedStackStringStream css;
+ auto estimate = mds->mdlog->get_estimated_replay_finish_time();
+ // this probably should be configurable, however, its fine to report
+ // if replay is running for more than 30 seconds.
+ if (estimate.elapsed_time > std::chrono::seconds(30)) {
+ *css << "replay: " << estimate.percent_complete << "% complete - elapsed time: "
+ << estimate.elapsed_time << ", estimated time remaining: "
+ << estimate.estimated_time;
+ MDSHealthMetric m(MDS_HEALTH_ESTIMATED_REPLAY_TIME, HEALTH_WARN, css->strv());
+ health.metrics.push_back(m);
+ }
+ }
}
MDSMap::DaemonState Beacon::get_want_state() const