On 11 Jul 2022, at 13:44, Marshall Royce <marshal...@gmail.com> wrote:
Hello all, I'm currently working on adding a feature to Telegraf's mqtt_consumer plugin, I'm wanting to be able to calculate the message size received by the network interface in order to calculate the throughput (bytes/minute) being sent from the mqtt server. This is all written in Golang, is this possible? Right now I essentially just sum together each part of the incoming message (Payload, topic, QoS, message ID, duplicate, and retained) by using len() on the strings and byte arrays, and Unsafe.sizeof() on the rest. However, I believe this is getting the size that the message takes up in memory rather than the actual size of the message itself. Any suggestions or pointers? thanks in advance!
--
To learn more about MQTT see https://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/a0996619-4fc3-486c-a580-8c3d41bf1975n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/e43ee83f-be88-4d5b-9646-2813e2e6b757n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/8a0d4567-e47f-4b2b-83f9-c1608117c4b4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/25432C09-C743-4A78-8A5D-B9CDB64CCDFC%40stanford-Clark.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/CAH7zdydpiFNWL6bkg9tSSA7KV_vGzTE5qp3OqMx-pudQqBgeRw%40mail.gmail.com.