Просмотр исходного кода

docs(schema): Document rate_limit fields

ieQu1 3 лет назад
Родитель
Сommit
465e0e418c
2 измененных файлов с 15 добавлено и 4 удалено
  1. 1 1
      apps/emqx/etc/emqx.conf
  2. 14 3
      apps/emqx/src/emqx_schema.erl

+ 1 - 1
apps/emqx/etc/emqx.conf

@@ -936,7 +936,7 @@ rate_limit {
   ##   max_conn_rate: 1000
   max_conn_rate = 1000
 
-  ## Message limit for the a external MQTT connection.
+  ## Message limit for the external MQTT connections.
   ##
   ## @doc rate_limit.conn_messages_in
   ## ValueType: String | infinity

+ 14 - 3
apps/emqx/src/emqx_schema.erl

@@ -623,17 +623,28 @@ fields("rate_limit") ->
         {"max_conn_rate",
             sc(
                 hoconsc:union([infinity, integer()]),
-                #{default => 1000}
+                #{
+                    default => 1000,
+                    desc => "Maximum connections per second."
+                }
             )},
         {"conn_messages_in",
             sc(
                 hoconsc:union([infinity, comma_separated_list()]),
-                #{default => infinity}
+                #{
+                    default => infinity,
+                    desc => "Message limit for the external MQTT connections."
+                }
             )},
         {"conn_bytes_in",
             sc(
                 hoconsc:union([infinity, comma_separated_list()]),
-                #{default => infinity}
+                #{
+                    default => infinity,
+                    desc =>
+                        "Limit the rate of receiving packets for a MQTT connection.\n"
+                        "The rate is counted by bytes of packets per second."
+                }
             )}
     ];
 fields("flapping_detect") ->