MQTT---hivemq source detailed (10) netty-statistics

Source: Internet
Author: User
Tags influxdb

Hivemq in the built-in statistics is very much, more terrible, almost you can think of statistics hivemq have been to help you think of all, and the third party plugin can also define their own statistics.

Its implementation uses the metric framework to achieve statistics, measurement. The collected data can be used to report interfaces through a variety of data, which can monitor various data in the broker's operation to monitor the broker.

The so-called statistics is the acquisition of buried points, output reports to collect buried point class diagram

    1. The Handleradded method is implemented by Statisticsinitializer, adding globaltrafficcounter (Flow counter), Globalmqttmessagecounter ( MQTT Message Count counter), Mqttconnectioncounterhandler (Mqtt Connection Count counter)

    2. Globaltrafficcounter inherits the Netty Globaltrafficshapinghandler to obtain the traffic counter to count the current (last 5 seconds) read/write traffic, and the accumulated read/write traffic.

    3. Globalmqttmessagecounter counts the number of read/write and throughput for each MQTT message, based on the current MQTT message type.

    4. Mqttconnectioncounterhandler counts the total number of connections, the current number of connections, by listening to the MQTT connect message and the closefuture of the current channel Mqttconnectioncounter Data Fine-grained a readwritelock with a statistic to provide increase, decrease, and the current number of connections, the maximum number of connections query class.

In this way, statistics on the connection, traffic and quantity are handler, and the statistic burying point is reached to collect the traffic information in the broker.
The website also provides us with a JVM monitoring plugin.
Https://github.com/hivemq/jvm-metrics-plugin

Output report

Since the data has been collected into the metric, then the output is relatively simple, and the output is a personalized demand, HIVEMQ is the plugin way to output the report, the official website for us to provide several output plug-ins.
1. Publish it in $sys theme. Https://github.com/hivemq/hivemq-sys-topic-plugin
2, output to the influxdb. Https://github.com/hivemq/influxdb-monitoring-plugin

Built-in collection information enumeration

The following list is basically the name of the known, bloggers will not give everyone to explain.

    Private FinalCounter Incomingmessagecount;Private FinalCounter Outgoingmessagecount;Private FinalMeter incomingmessagerate;Private FinalMeter outgoingmessagerate;Private FinalMeter outgoingconnackrate;Private FinalCounter Outgoingconnackcount;Private FinalMeter incomingconnectrate;Private FinalCounter Incomingconnectcount;Private FinalMeter incomingdisconnectrate;Private FinalCounter Incomingdisconnectcount;Private FinalMeter incomingpingreqrate;Private FinalCounter Incomingpingreqcount;Private FinalMeter outgoingpingresprate;Private FinalCounter Outgoingpingrespcount;Private FinalMeter incomingpubackrate;Private FinalCounter Incomingpubackcount;Private FinalMeter outgoingpubackrate;Private FinalCounter Outgoingpubackcount;Private FinalMeter incomingpubcomprate;Private FinalCounter Incomingpubcompcount;Private FinalMeter outgoingpubcomprate;Private FinalCounter Outgoingpubcompcount;Private FinalMeter incomingpublishrate;Private FinalCounter Incomingpublishcount;Private FinalMeter outgoingpublishrate;Private FinalCounter Outgoingpublishcount;Private FinalMeter incomingpubrecrate;Private FinalCounter Incomingpubreccount;Private FinalMeter outgoingpubrecrate;Private FinalCounter Outgoingpubreccount;Private FinalMeter incomingpubrelrate;Private FinalCounter Incomingpubrelcount;Private FinalMeter outgoingpubrelrate;Private FinalCounter Outgoingpubrelcount;Private FinalMeter outgoingsubackrate;Private FinalCounter Outgoingsubackcount;Private FinalMeter incomingsubscriberate;Private FinalCounter Incomingsubscribecount;Private FinalMeter outgoingunsubackrate;Private FinalCounter Outgoingunsubackcount;Private FinalMeter incomingunsubscriberate;Private FinalCounter Incomingunsubscribecount;Private FinalCounter Halffullqueuecount;Private FinalMeter droppedmessagerate;Private FinalCounter Droppedmessagecount;Private FinalMeter publishqueuerate;Private FinalCounter publishqueuesize;Private FinalCounter persistentsessionsactive;Private FinalHistogram Connectionsoverallmean;Private FinalHistogram Incomingmessagesizemean;Private FinalHistogram Outgoingmessagesizemean;Private FinalHistogram Incomingpublishsizemean;Private FinalHistogram Outgoingpublishsizemean;Private FinalHistogram Retainedmessagesmean;Private FinalMeter retainedmessagesrate;Private FinalCounter subscriptionscurrent;Private FinalTimer plugintimerafterloginsuccess;Private FinalTimer plugintimerafterloginfailed;Private FinalTimer plugintimerauthentication;Private FinalTimer plugintimerrestrictions;Private FinalTimer plugintimerauthorization;Private FinalTimer Plugintimerpermissionsdisconnectpublish;Private FinalTimer Plugintimerpermissionsdisconnectsubscribe;Private FinalTimer Plugintimerconnect;Private FinalTimer Plugintimerdisconnect;Private FinalTimer Plugintimerconnacksend;Private FinalTimer Plugintimerpubacksend;Private FinalTimer plugintimerpubackreceived;Private FinalTimer plugintimerpubcompreceived;Private FinalTimer plugintimerpublishreceived;Private FinalTimer Plugintimerpublishsend;Private FinalTimer Plugintimersubscribe;Private FinalTimer Plugintimerunsubscribe;Private FinalTimer plugintimerping;Private FinalTimer plugintimerpubrelreceived;Private FinalTimer plugintimerpubrecreceived;Private FinalTimer Plugintimerpubcompsend;Private FinalTimer Plugintimerpubrecsend;Private FinalTimer Plugintimerpubrelsend;Private FinalTimer Plugintimersubacksend;Private FinalTimer Plugintimerunsubacksend;Private FinalMeter totalexceptionrate;
MQTT Exchange Group: 221405150

MQTT---hivemq source detailed (10) netty-statistics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.