This allows us to figure out how often we receive updates from upstream
dbs. In addition we can see e.g. during a reconnection if we did clear
the database (e.g. because monitor_cond_since did not work).

Signed-off-by: Felix Huettner <[email protected]>
---
 lib/ovsdb-cs.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c
index df33a835d..0f0f88ef7 100644
--- a/lib/ovsdb-cs.c
+++ b/lib/ovsdb-cs.c
@@ -20,6 +20,7 @@
 
 #include <errno.h>
 
+#include "coverage.h"
 #include "hash.h"
 #include "jsonrpc.h"
 #include "openvswitch/dynamic-string.h"
@@ -38,6 +39,9 @@
 #include "uuid.h"
 
 VLOG_DEFINE_THIS_MODULE(ovsdb_cs);
+COVERAGE_DEFINE(ovsdb_cs_update);
+COVERAGE_DEFINE(ovsdb_cs_update_with_clear);
+COVERAGE_DEFINE(ovsdb_cs_update_from_monitor);
 
 /* Connection state machine.
  *
@@ -1568,6 +1572,14 @@ ovsdb_cs_db_add_update(struct ovsdb_cs_db *db,
                        const struct json *table_updates, int version,
                        bool clear, bool monitor_reply)
 {
+    COVERAGE_INC(ovsdb_cs_update);
+    if (clear) {
+        COVERAGE_INC(ovsdb_cs_update_with_clear);
+    }
+    if (monitor_reply) {
+        COVERAGE_INC(ovsdb_cs_update_from_monitor);
+    }
+
     struct ovsdb_cs_event *event = ovsdb_cs_db_add_event(
         db, OVSDB_CS_EVENT_TYPE_UPDATE);
     event->update = (struct ovsdb_cs_update_event) {
-- 
2.43.0


   
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to