Merge pull request #9664 from thalesmg/fix-mongo-duration-field-descs-v50

docs(mongodb_connector): fix duration field descriptions
This commit is contained in:
Thales Macedo Garitezi 2023-01-04 10:03:38 -03:00 committed by GitHub
commit 00b91d8a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 112 additions and 22 deletions

View File

@ -106,15 +106,103 @@ The MongoDB default port 27017 is used if `[:Port]` is not specified.
}
}
duration {
desc {
en: "Time interval, such as timeout or TTL."
zh: "时间间隔,例如超时或 TTL。"
}
label: {
en: "Time Interval"
zh: "时间间隔"
}
overflow_ttl {
desc {
en: "Period of time before workers that exceed the configured pool size (\"overflow\") to be terminated."
zh: "当池内工人太多时,等待多久清除多余工人。"
}
label {
en: "Overflow TTL"
zh: "溢出TTL"
}
}
overflow_check_period {
desc {
en: "Period for checking if there are more workers than configured (\"overflow\")."
zh: "检查是否有超过配置的工人的周期(\"溢出\")。"
}
label {
en: "Overflow Check Period"
zh: "溢出检查周期"
}
}
local_threshold {
desc {
en: "The size of the latency window for selecting among multiple suitable MongoDB instances."
zh: "在多个合适的MongoDB实例中进行选择的延迟窗口的大小。"
}
label {
en: "Local Threshold"
zh: "本地阈值"
}
}
connect_timeout {
desc {
en: "The duration to attempt a connection before timing out."
zh: "超时重连的等待时间。"
}
label {
en: "Connect Timeout"
zh: "连接超时"
}
}
socket_timeout {
desc {
en: "The duration to attempt to send or to receive on a socket before the attempt times out."
zh: "在尝试超时之前,在套接字上尝试发送或接收的持续时间。"
}
label {
en: "Socket Timeout"
zh: "套接字操作超时"
}
}
server_selection_timeout {
desc {
en: "Specifies how long to block for server selection before throwing an exception."
zh: "指定在抛出异常之前为服务器选择阻断多长时间。"
}
label {
en: "Server Selection Timeout"
zh: "服务器选择超时"
}
}
wait_queue_timeout {
desc {
en: "The maximum duration that a worker can wait for a connection to become available."
zh: "工作者等待连接可用的最长时间。"
}
label {
en: "Wait Queue Timeout"
zh: "等待队列超时"
}
}
heartbeat_period {
desc {
en: "Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one."
zh: "控制驱动程序何时检查MongoDB部署的状态。指定检查的间隔时间从上一次检查结束到下一次检查开始计算。"
}
label {
en: "Heartbeat period"
zh: "心跳期"
}
}
min_heartbeat_period {
desc {
en: "Controls the minimum amount of time to wait between heartbeats."
zh: "心跳间的最小间隙"
}
label {
en: "Minimum Heartbeat Period"
zh: "最小心跳周期"
}
}
max_overflow {

View File

@ -102,15 +102,15 @@ fields(topology) ->
[
{pool_size, fun emqx_connector_schema_lib:pool_size/1},
{max_overflow, fun max_overflow/1},
{overflow_ttl, fun duration/1},
{overflow_check_period, fun duration/1},
{local_threshold_ms, fun duration/1},
{connect_timeout_ms, fun duration/1},
{socket_timeout_ms, fun duration/1},
{server_selection_timeout_ms, fun duration/1},
{wait_queue_timeout_ms, fun duration/1},
{heartbeat_frequency_ms, fun duration/1},
{min_heartbeat_frequency_ms, fun duration/1}
{overflow_ttl, duration("overflow_ttl")},
{overflow_check_period, duration("overflow_check_period")},
{local_threshold_ms, duration("local_threshold")},
{connect_timeout_ms, duration("connect_timeout")},
{socket_timeout_ms, duration("socket_timeout")},
{server_selection_timeout_ms, duration("server_selection_timeout")},
{wait_queue_timeout_ms, duration("wait_queue_timeout")},
{heartbeat_frequency_ms, duration("heartbeat_period")},
{min_heartbeat_frequency_ms, duration("min_heartbeat_period")}
].
desc(single) ->
@ -403,10 +403,12 @@ r_mode(desc) -> ?DESC("r_mode");
r_mode(default) -> master;
r_mode(_) -> undefined.
duration(type) -> emqx_schema:duration_ms();
duration(desc) -> ?DESC("duration");
duration(required) -> false;
duration(_) -> undefined.
duration(Desc) ->
#{
type => emqx_schema:duration_ms(),
required => false,
desc => ?DESC(Desc)
}.
max_overflow(type) -> non_neg_integer();
max_overflow(desc) -> ?DESC("max_overflow");