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

refactor: rename async_inflight_window to inflight_window everywhere

Kjell Winblad 2 лет назад
Родитель
Сommit
35474578ca

+ 1 - 1
apps/emqx_bridge/src/emqx_bridge_api.erl

@@ -238,7 +238,7 @@ info_example_basic(webhook) ->
             health_check_interval => 15000,
             auto_restart_interval => 15000,
             query_mode => async,
-            async_inflight_window => 100,
+            inflight_window => 100,
             max_queue_bytes => 100 * 1024 * 1024
         }
     };

+ 1 - 1
apps/emqx_bridge/src/schema/emqx_bridge_compatible_config.erl

@@ -86,7 +86,7 @@ default_ssl() ->
 
 default_resource_opts() ->
     #{
-        <<"async_inflight_window">> => 100,
+        <<"inflight_window">> => 100,
         <<"auto_restart_interval">> => <<"60s">>,
         <<"health_check_interval">> => <<"15s">>,
         <<"max_queue_bytes">> => <<"1GB">>,

+ 1 - 1
apps/emqx_bridge/test/emqx_bridge_webhook_SUITE.erl

@@ -172,7 +172,7 @@ bridge_async_config(#{port := Port} = Config) ->
         "  request_timeout = \"~ps\"\n"
         "  body = \"${id}\""
         "  resource_opts {\n"
-        "    async_inflight_window = 100\n"
+        "    inflight_window = 100\n"
         "    auto_restart_interval = \"60s\"\n"
         "    health_check_interval = \"15s\"\n"
         "    max_queue_bytes = \"1GB\"\n"

+ 1 - 1
apps/emqx_resource/include/emqx_resource.hrl

@@ -73,7 +73,7 @@
     max_queue_bytes => pos_integer(),
     query_mode => query_mode(),
     resume_interval => pos_integer(),
-    async_inflight_window => pos_integer()
+    inflight_window => pos_integer()
 }.
 -type query_result() ::
     ok

+ 1 - 1
apps/emqx_resource/src/emqx_resource_buffer_worker.erl

@@ -193,7 +193,7 @@ init({Id, Index, Opts}) ->
     Queue = replayq:open(QueueOpts),
     emqx_resource_metrics:queuing_set(Id, Index, queue_count(Queue)),
     emqx_resource_metrics:inflight_set(Id, Index, 0),
-    InflightWinSize = maps:get(async_inflight_window, Opts, ?DEFAULT_INFLIGHT),
+    InflightWinSize = maps:get(inflight_window, Opts, ?DEFAULT_INFLIGHT),
     InflightTID = inflight_new(InflightWinSize, Id, Index),
     HealthCheckInterval = maps:get(health_check_interval, Opts, ?HEALTHCHECK_INTERVAL),
     RequestTimeout = maps:get(request_timeout, Opts, ?DEFAULT_REQUEST_TIMEOUT),

+ 5 - 5
apps/emqx_resource/test/emqx_resource_SUITE.erl

@@ -369,7 +369,7 @@ t_query_counter_async_callback(_) ->
         #{
             query_mode => async,
             batch_size => 1,
-            async_inflight_window => 1000000
+            inflight_window => 1000000
         }
     ),
     ?assertMatch({ok, 0}, emqx_resource:simple_sync_query(?ID, get_counter)),
@@ -450,7 +450,7 @@ t_query_counter_async_inflight(_) ->
         #{
             query_mode => async,
             batch_size => 1,
-            async_inflight_window => WindowSize,
+            inflight_window => WindowSize,
             worker_pool_size => 1,
             resume_interval => 300
         }
@@ -634,7 +634,7 @@ t_query_counter_async_inflight_batch(_) ->
             query_mode => async,
             batch_size => BatchSize,
             batch_time => 100,
-            async_inflight_window => WindowSize,
+            inflight_window => WindowSize,
             worker_pool_size => 1,
             resume_interval => 300
         }
@@ -1584,7 +1584,7 @@ t_retry_async_inflight_full(_Config) ->
         #{name => ?FUNCTION_NAME},
         #{
             query_mode => async,
-            async_inflight_window => AsyncInflightWindow,
+            inflight_window => AsyncInflightWindow,
             batch_size => 1,
             worker_pool_size => 1,
             resume_interval => ResumeInterval
@@ -1642,7 +1642,7 @@ t_async_reply_multi_eval(_Config) ->
         #{name => ?FUNCTION_NAME},
         #{
             query_mode => async,
-            async_inflight_window => AsyncInflightWindow,
+            inflight_window => AsyncInflightWindow,
             batch_size => 3,
             batch_time => 10,
             worker_pool_size => 1,

+ 1 - 1
scripts/test/influx/influx-bridge.conf

@@ -6,7 +6,7 @@ bridges {
       org = "emqx"
       precision = "ms"
       resource_opts {
-        async_inflight_window = 100
+        inflight_window = 100
         auto_restart_interval = "60s"
         batch_size = 100
         batch_time = "10ms"