diff options
Diffstat (limited to 'lib/input')
-rw-r--r-- | lib/input/replStream.cpp | 2 | ||||
-rw-r--r-- | lib/input/replStream.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/input/replStream.cpp b/lib/input/replStream.cpp index d04e16b..3bfe877 100644 --- a/lib/input/replStream.cpp +++ b/lib/input/replStream.cpp @@ -39,8 +39,10 @@ namespace MyGrate::Input { verify<MySQLErr>(!mariadb_rpl_open(rpl.get()), "Failed to mariadb_rpl_open", this); while (MyGrate::MariaDB_Event_Ptr event {mariadb_rpl_fetch(rpl.get(), nullptr), &mariadb_free_rpl_event}) { + received.tick(event->event_type); auto np = event->next_event_pos; if (const auto & h = eventHandlers.at(event->event_type); h.func) { + handled.tick(event->event_type); (eh.*h.func)(std::move(event)); } position = np; diff --git a/lib/input/replStream.h b/lib/input/replStream.h index 40ec390..4958459 100644 --- a/lib/input/replStream.h +++ b/lib/input/replStream.h @@ -3,6 +3,7 @@ #include "mysqlConn.h" #include <cstdint> +#include <eventCounter.h> #include <eventSourceBase.h> #include <string> @@ -19,10 +20,14 @@ namespace MyGrate::Input { void readEvents(EventHandlerBase &) override; void stopEvents() override; + const EventCounter & getReceivedCounts() const; + const EventCounter & getHandledCounts() const; + private: uint64_t serverid; std::string filename; uint64_t position; + EventCounter received, handled; }; } |