examples: add statistics to request_reply

I should probably write some tests instead.
This commit is contained in:
torque 2023-08-23 22:18:45 -07:00
parent 3816f32101
commit 18205a5533
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -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 },
);
}