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

$SYS topic to get the number of connected clients. #82

Closed
wants to merge 2 commits into from

Conversation

debjeetsarkar
Copy link

No description provided.

@coveralls
Copy link

coveralls commented Jan 27, 2017

Coverage Status

Coverage increased (+0.02%) to 97.081% when pulling 1c4e69d on debjeet-sarkar:master into ac6cbad on mcollina:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.081% when pulling 1c4e69d on debjeet-sarkar:master into ac6cbad on mcollina:master.

this.connectedClients++
this.clients[client.id] = client
this.emit('client', client)
this.publish({
topic: '$SYS/' + this.id + '/new/clients',
payload: new Buffer(client.id, 'utf8')
}, noop)

this.publish({
topic: '$SYS/' + this.id + '/clients/total',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be $SYS/broker/clients/total and it should be a retained message

@mcollina
Copy link
Collaborator

I do not think this is the correct approach, but rather we should the same pattern we have for Mosca, https://github.com/mcollina/mosca/blob/master/lib/stats.js.

In fact I even created https://github.com/mcollina/aedes-stats, but it is empty :(. If you want to contribute things there, I would be very happy.

@debjeetsarkar
Copy link
Author

@mcollina, makes sense.

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

Successfully merging this pull request may close these issues.

4 participants