From 18205a55334e06c99039315503215eb846ee623c Mon Sep 17 00:00:00 2001 From: torque Date: Wed, 23 Aug 2023 22:18:45 -0700 Subject: [PATCH] examples: add statistics to request_reply I should probably write some tests instead. --- examples/request_reply.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/request_reply.zig b/examples/request_reply.zig index d1f724b..65fa497 100644 --- a/examples/request_reply.zig +++ b/examples/request_reply.zig @@ -38,4 +38,10 @@ pub fn main() !void { reply.getData() orelse "[null]", }); } + + const stats = try connection.getStats(); + std.debug.print( + "Server stats => {{\n\tmessages_in: {d} ({d} B),\n\tmessages_out: {d} ({d} B),\n\treconnects: {d}\n}}\n", + .{ stats.messages_in, stats.bytes_in, stats.messages_out, stats.bytes_out, stats.reconnects }, + ); }