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]>
---
v2->v3: adressed nits from Ilja

 lib/ovsdb-cs.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c
index df33a835d..e41958c36 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"
@@ -39,6 +40,10 @@
 
 VLOG_DEFINE_THIS_MODULE(ovsdb_cs);
 
+COVERAGE_DEFINE(cs_update);
+COVERAGE_DEFINE(cs_update_with_clear);
+COVERAGE_DEFINE(cs_update_from_monitor);
+
 /* Connection state machine.
  *
  * When a JSON-RPC session connects, the CS layer sends a "monitor_cond"
@@ -1568,6 +1573,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(cs_update);
+    if (clear) {
+        COVERAGE_INC(cs_update_with_clear);
+    }
+    if (monitor_reply) {
+        COVERAGE_INC(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