X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Ftools%2Frbd_mirror%2Fimage_replayer%2Fjournal%2FReplayStatusFormatter.h;h=5dbbfe10d17607a4ac010251dc303cd5e18aaba9;hb=1911f103e16ae0d04db10fb41db8217ef4c320d3;hp=5ba000a16664c413ce663a88e354c292db31159d;hpb=78f773100ed5d2ebc9d99e65a3d7e3a6f541a97e;p=ceph.git diff --git a/ceph/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.h b/ceph/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.h index 5ba000a16..5dbbfe10d 100644 --- a/ceph/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.h +++ b/ceph/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.h @@ -9,6 +9,7 @@ #include "cls/journal/cls_journal_types.h" #include "librbd/journal/Types.h" #include "librbd/journal/TypeTraits.h" +#include "tools/rbd_mirror/image_replayer/TimeRollingMean.h" namespace journal { class Journaler; } namespace librbd { class ImageCtx; } @@ -34,6 +35,8 @@ public: ReplayStatusFormatter(Journaler *journaler, const std::string &mirror_uuid); + void handle_entry_processed(uint32_t bytes); + bool get_or_send_update(std::string *description, Context *on_finish); private: @@ -43,10 +46,13 @@ private: Context *m_on_finish = nullptr; cls::journal::ObjectPosition m_master_position; cls::journal::ObjectPosition m_mirror_position; - int m_entries_behind_master = 0; + int64_t m_entries_behind_master = 0; cls::journal::Tag m_tag; std::map m_tag_cache; + TimeRollingMean m_bytes_per_second; + TimeRollingMean m_entries_per_second; + bool calculate_behind_master_or_send_update(); void send_update_tag_cache(uint64_t master_tag_tid, uint64_t mirror_tag_tid); void handle_update_tag_cache(uint64_t master_tag_tid, uint64_t mirror_tag_tid,