aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/pubsub0/pub_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-08-10 10:45:13 -0700
committerGarrett D'Amore <garrett@damore.org>2025-08-10 10:45:13 -0700
commit77dc72635e64d959822b86562ff57f3fde79b5ac (patch)
tree0a5b53273128dab61b4662f2c8ccbf0af224d3bb /src/sp/protocol/pubsub0/pub_test.c
parent72dc573e732049353c64b1a58d5df24f3f661b9c (diff)
downloadnng-pub-stats.tar.gz
nng-pub-stats.tar.bz2
nng-pub-stats.zip
fixes #2146 need statistics for PUB protocolpub-stats
Diffstat (limited to 'src/sp/protocol/pubsub0/pub_test.c')
-rw-r--r--src/sp/protocol/pubsub0/pub_test.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sp/protocol/pubsub0/pub_test.c b/src/sp/protocol/pubsub0/pub_test.c
index 2b571bef..3018ced9 100644
--- a/src/sp/protocol/pubsub0/pub_test.c
+++ b/src/sp/protocol/pubsub0/pub_test.c
@@ -96,6 +96,17 @@ test_pub_send_no_pipes(void)
NUTS_PASS(nng_pub0_open(&pub));
NUTS_SEND(pub, "DROP1");
NUTS_SEND(pub, "DROP2");
+
+ nng_stat *stats;
+ const nng_stat *pubs;
+ NUTS_PASS(nng_stats_get(&stats));
+
+ NUTS_TRUE(stats != NULL);
+ NUTS_TRUE((pubs = nng_stat_find_socket(stats, pub)) != NULL);
+
+ nng_stats_dump(pubs);
+ nng_stats_free(stats);
+
NUTS_CLOSE(pub);
}
@@ -127,6 +138,7 @@ test_pub_validate_peer(void)
NUTS_CLOSE(s1);
NUTS_CLOSE(s2);
+ nng_stats_dump(stats);
nng_stats_free(stats);
}
@@ -157,6 +169,16 @@ test_pub_send_queued(void)
NUTS_RECV(sub, "three musketeers");
NUTS_RECV(sub, "four");
+ nng_stat *stats;
+ const nng_stat *pubs;
+ NUTS_PASS(nng_stats_get(&stats));
+
+ NUTS_TRUE(stats != NULL);
+ NUTS_TRUE((pubs = nng_stat_find_socket(stats, pub)) != NULL);
+
+ nng_stats_dump(pubs);
+ nng_stats_free(stats);
+
NUTS_CLOSE(pub);
NUTS_CLOSE(sub);
}