Skip to content
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

Merged
merged 6 commits into from Apr 14, 2019
Merged

Conversation

hui6075
Copy link
Contributor

@hui6075 hui6075 commented Feb 1, 2018

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

@tisba
Copy link
Collaborator

tisba commented Jun 11, 2018

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!

Copy link
Contributor

@nniclausse nniclausse left a 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

@hui6075
Copy link
Contributor Author

hui6075 commented Jun 19, 2018

@tisba Yes, I would like to resolve the conflict.
@nniclausse thanks for the comments!

@tisba
Copy link
Collaborator

tisba commented Jun 19, 2018

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?

@hui6075
Copy link
Contributor Author

hui6075 commented Jun 19, 2018

@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?

@tisba
Copy link
Collaborator

tisba commented Jun 21, 2018

@hui6075 This can very simple IMO. Maybe just like in 6.6.3.1, but for MQTT.

@hui6075
Copy link
Contributor Author

hui6075 commented Jun 22, 2018

@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 .

@tisba
Copy link
Collaborator

tisba commented Jul 27, 2018

@tisba tisba added this to the 1.8.0 milestone Jul 27, 2018
@hui6075
Copy link
Contributor Author

hui6075 commented Feb 19, 2019

@tisba sorry for late due to some personal issue. conf-sessions.rst was updated, could you give a review?

docs/conf-sessions.rst Outdated Show resolved Hide resolved
@tisba
Copy link
Collaborator

tisba commented Feb 19, 2019

No worries, thank you for keep this going! :)

@tisba tisba merged commit 6a5efba into processone:develop Apr 14, 2019
@tisba
Copy link
Collaborator

tisba commented Apr 14, 2019

Sorry for taking me so long to take another look :( Thank you for your contribution 🎉

@hui6075
Copy link
Contributor Author

hui6075 commented Apr 17, 2019

you are welcome:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants