From f3614b2c6577108461d7d8f44cc5281a4fb1253e Mon Sep 17 00:00:00 2001 From: firest Date: Mon, 10 Apr 2023 10:59:46 +0800 Subject: [PATCH 1/3] chore: add README for slow subscriptions --- apps/emqx_slow_subs/README.md | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 apps/emqx_slow_subs/README.md diff --git a/apps/emqx_slow_subs/README.md b/apps/emqx_slow_subs/README.md new file mode 100644 index 000000000..e4454a56c --- /dev/null +++ b/apps/emqx_slow_subs/README.md @@ -0,0 +1,41 @@ +# EMQX Slow Subscriptions + +This application can calculate the latency (time spent) of the message to be processed and transmitted since it arrives at EMQX. + +If the latency exceeds a specified threshold, this application will add the subscriber and topic information to a slow subscriptions list or update the existing record. + +# How To Use + +You can add the below section into `emqx.conf` to enable this application + + +```yaml +slow_subs { + enable = true + threshold = "500ms" + expire_interval = "300s" + top_k_num = 10 + stats_type = whole +} +``` + +**threshold**: Latency threshold for statistics, only messages with latency exceeding this value will be collected. + +Minimum value: 100ms +Default value: 500ms + +**expire_interval**: Eviction time of the record, will start the counting since the creation of the record, and the records that are not triggered again within this specified period will be removed from the rank list. + +Default: 300s + +**top_k_num**: Maximum number of records in the slow subscription statistics record table. + +Maximum value: 1,000 +Default value: 10 + +**stats_type**: Calculation methods of the latency, which are +- **whole**: From the time the message arrives at EMQX until the message transmission completes +- **internal**: From when the message arrives at EMQX until when EMQX starts delivering the message +- **response**: From the time EMQX starts delivering the message until the message transmission completes + +Default value: whole From 69e334a77d9226c7c673e987008f53babc0b396e Mon Sep 17 00:00:00 2001 From: firest Date: Tue, 18 Apr 2023 17:25:11 +0800 Subject: [PATCH 2/3] chore: reorganize the README to follow template --- apps/emqx_slow_subs/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/emqx_slow_subs/README.md b/apps/emqx_slow_subs/README.md index e4454a56c..cfc87f775 100644 --- a/apps/emqx_slow_subs/README.md +++ b/apps/emqx_slow_subs/README.md @@ -4,11 +4,12 @@ This application can calculate the latency (time spent) of the message to be pro If the latency exceeds a specified threshold, this application will add the subscriber and topic information to a slow subscriptions list or update the existing record. -# How To Use +More introduction: [Slow Subscriptions](https://www.emqx.io/docs/en/v5.0/observability/slow-subscribers-statistics.html) + +# Usage You can add the below section into `emqx.conf` to enable this application - ```yaml slow_subs { enable = true @@ -19,6 +20,8 @@ slow_subs { } ``` +# Configurations + **threshold**: Latency threshold for statistics, only messages with latency exceeding this value will be collected. Minimum value: 100ms @@ -28,7 +31,7 @@ Default value: 500ms Default: 300s -**top_k_num**: Maximum number of records in the slow subscription statistics record table. +**top_k_num**: Maximum number of records in the slow subscription statistics record table. Maximum value: 1,000 Default value: 10 @@ -39,3 +42,6 @@ Default value: 10 - **response**: From the time EMQX starts delivering the message until the message transmission completes Default value: whole + +# Contributing - [Mandatory] +Please see our [contributing.md](../../CONTRIBUTING.md). From d947b663271890d4ceafde55254e83afa935add2 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Wed, 19 Apr 2023 09:51:19 +0800 Subject: [PATCH 3/3] chore: update apps/emqx_slow_subs/README.md --- apps/emqx_slow_subs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_slow_subs/README.md b/apps/emqx_slow_subs/README.md index cfc87f775..8b83508c2 100644 --- a/apps/emqx_slow_subs/README.md +++ b/apps/emqx_slow_subs/README.md @@ -43,5 +43,5 @@ Default value: 10 Default value: whole -# Contributing - [Mandatory] +# Contributing Please see our [contributing.md](../../CONTRIBUTING.md).