New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add forwarding latency statistic for mqtt #287
Conversation
Same as with #272, can you review this, @nniclausse? Also, @hui6075, thanks for your first contribution! Could you please take care of the conflicting files? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code looks good and the feature useful
@tisba Yes, I would like to resolve the conflict. |
Nice! Could you add some documentation as well, @hui6075? I was also wondering if this is a MQTT feature, or if it just changing the payload which needs to be taken care of at the MQTT server/broker? |
@tisba Thank you, this just add the time stamp ahead of the payload, same with the time stamp feature(described in Tsung 1.7.0 documentation section 6.6.3.1) in Tsung XMPP module. How should I add the documentation? |
@hui6075 This can very simple IMO. Maybe just like in 6.6.3.1, but for MQTT. |
@tisba ,see below user guide, It is possible to measure the broker's forwarding latency by setting stamped attribute inside publish element to true, i.e., . The stamp will include current timestamp and ID of the sender node. If the recipient will recognize the node ID, it will compare the timestamp inside message with the current one. The difference will be reported as mqtt_forward_latency metric (in milliseconds). The aim of node ID comparison is to avoid slight inconsistencies of timestamps on different Tsung nodes. Note that the stamp will be add ahead of the publish payload and will increase publish payload size. Only a fraction of requests will hit the same node they originated from, but with request rate high enough this fraction should be sufficient. btw, I also add the time stamp param inside examples/mqtt.xml.in . |
@hui6075 could you add this to https://github.com/processone/tsung/blob/develop/docs/conf-sessions.rst#mqtt? |
@tisba sorry for late due to some personal issue. conf-sessions.rst was updated, could you give a review? |
No worries, thank you for keep this going! :) |
Sorry for taking me so long to take another look :( Thank you for your contribution 🎉 |
you are welcome:) |
Hi,
I have add the "stamped" label for mqtt publish request which can give a measurement for the message forwarding latency between publish time and receive time. Same as xmpp_msg_latency in Jabber module.
As we know, mqtt is mainly used in IOT environment, e.g., use the mobile device to control some house appliance. So the forwarding latency is quite a performance target to evaluate a mqtt broker.
Usage:
make stamped="true" in mqtt.xml, i.e.,
<mqtt type="publish" topic="test_topic" qos="1" retained="true" stamped="false">test_message