From 9f7be0292a2b6584d08101367a50c27491ca66bd Mon Sep 17 00:00:00 2001 From: aias00 Date: Sun, 11 Aug 2024 22:12:27 +0800 Subject: [PATCH] [improve] add hertzbeat i18n (#2506) Co-authored-by: tomsun28 --- .../main/resources/define/app-dynamic_tp.yml | 2 +- .../src/main/resources/define/app-emqx.yml | 111 ++++++++++++++++++ .../src/main/resources/define/app-euleros.yml | 2 +- .../main/resources/define/app-hertzbeat.yml | 66 +++++++++++ .../resources/define/app-hertzbeat_token.yml | 75 ++++++++++++ 5 files changed, 254 insertions(+), 2 deletions(-) diff --git a/manager/src/main/resources/define/app-dynamic_tp.yml b/manager/src/main/resources/define/app-dynamic_tp.yml index f2be6b2613d..c57f1b00e9c 100644 --- a/manager/src/main/resources/define/app-dynamic_tp.yml +++ b/manager/src/main/resources/define/app-dynamic_tp.yml @@ -19,7 +19,7 @@ category: program app: dynamic_tp # The monitoring i18n name name: - zh-CN: DynamicTp线程池 + zh-CN: DynamicTp 线程池 en-US: DynamicTp Pool # The description and help of this monitoring type help: diff --git a/manager/src/main/resources/define/app-emqx.yml b/manager/src/main/resources/define/app-emqx.yml index 12d93a90a5f..e15695a26c0 100644 --- a/manager/src/main/resources/define/app-emqx.yml +++ b/manager/src/main/resources/define/app-emqx.yml @@ -162,6 +162,9 @@ metrics: parseScript: '$' - name: metrics + i18n: + zh-CN: 指标 + en-US: Metrics # metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel # priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue priority: 1 @@ -170,30 +173,69 @@ metrics: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics, unit-metric unit('%','ms','MB') - field: client_connected type: 0 + i18n: + zh-CN: 客户端连接 + en-US: Client Connected - field: client_disconnected type: 0 + i18n: + zh-CN: 客户端断开 + en-US: Client Disconnected - field: packets_sent type: 0 + i18n: + zh-CN: 发送数据包 + en-US: Packets Sent - field: packets_received type: 0 + i18n: + zh-CN: 接收数据包 + en-US: Packets Received - field: bytes_sent type: 0 + i18n: + zh-CN: 发送字节 + en-US: Bytes Sent - field: bytes_received type: 0 + i18n: + zh-CN: 接收字节 + en-US: Bytes Received - field: messages_sent type: 0 + i18n: + zh-CN: 发送消息 + en-US: Messages Sent - field: messages_acked type: 0 + i18n: + zh-CN: 消息确认 + en-US: Messages Acked - field: messages_delayed type: 0 + i18n: + zh-CN: 延迟消息 + en-US: Messages Delayed - field: authorization_deny type: 0 + i18n: + zh-CN: 授权拒绝 + en-US: Authorization Deny - field: client_authorize type: 0 + i18n: + zh-CN: 客户端授权 + en-US: Client Authorize - field: session_created type: 0 + i18n: + zh-CN: 会话创建 + en-US: Session Created - field: session_discarded type: 0 + i18n: + zh-CN: 会话丢弃 + en-US: Session Discarded # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field aliasFields: - client.connected @@ -251,53 +293,122 @@ metrics: parseScript: '$' - name: stats + i18n: + zh-CN: 统计 + en-US: Stats priority: 2 fields: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics, unit-metric unit('%','ms','MB') - field: channels_count type: 0 + i18n: + zh-CN: 通道数 + en-US: Channels Count - field: channels_max type: 0 + i18n: + zh-CN: 通道最大数 + en-US: Channels Max - field: connections_count type: 0 + i18n: + zh-CN: 连接数 + en-US: Connections Count - field: connections_max type: 0 + i18n: + zh-CN: 最大连接数 + en-US: Connections Max - field: delayed_count type: 0 + i18n: + zh-CN: 延迟数 + en-US: Delayed Count - field: delayed_max type: 0 + i18n: + zh-CN: 最大延迟数 + en-US: Delayed Max - field: live_connections_count type: 0 + i18n: + zh-CN: 活动连接数 + en-US: Live Connections Count - field: live_connections_max type: 0 + i18n: + zh-CN: 最大活动连接数 + en-US: Live Connections Max - field: retained_count type: 0 + i18n: + zh-CN: 保留数 + en-US: Retained Count - field: retained_max type: 0 + i18n: + zh-CN: 最大保留数 + en-US: Retained Max - field: sessions_count type: 0 + i18n: + zh-CN: 会话数 + en-US: Sessions Count - field: sessions_max type: 0 + i18n: + zh-CN: 最大会话数 + en-US: Sessions Max - field: suboptions_count type: 0 + i18n: + zh-CN: 订阅选项数 + en-US: Suboptions Count - field: suboptions_max type: 0 + i18n: + zh-CN: 最大订阅选项数 + en-US: Suboptions Max - field: subscribers_count type: 0 + i18n: + zh-CN: 订阅者数 + en-US: Subscribers Count - field: subscribers_max type: 0 + i18n: + zh-CN: 最大订阅者数 + en-US: Subscribers Max - field: subscriptions_count type: 0 + i18n: + zh-CN: 订阅数 + en-US: Subscriptions Count - field: subscriptions_max type: 0 + i18n: + zh-CN: 最大订阅数 + en-US: Subscriptions Max - field: subscriptions_shared_count type: 0 + i18n: + zh-CN: 共享订阅数 + en-US: Subscriptions Shared Count - field: subscriptions_shared_max type: 0 + i18n: + zh-CN: 最大共享订阅数 + en-US: Subscriptions Shared Max - field: topics_count type: 0 + i18n: + zh-CN: 主题数 + en-US: Topics Count - field: topics_max type: 0 + i18n: + zh-CN: 最大主题数 + en-US: Topics Max # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field aliasFields: - channels.count diff --git a/manager/src/main/resources/define/app-euleros.yml b/manager/src/main/resources/define/app-euleros.yml index 761830403dc..8bcbb4d52a3 100644 --- a/manager/src/main/resources/define/app-euleros.yml +++ b/manager/src/main/resources/define/app-euleros.yml @@ -19,7 +19,7 @@ category: os app: euleros # The monitoring i18n name name: - zh-CN: EulerOS操作系统 + zh-CN: EulerOS 操作系统 en-US: EulerOS # The description and help of this monitoring type help: diff --git a/manager/src/main/resources/define/app-hertzbeat.yml b/manager/src/main/resources/define/app-hertzbeat.yml index 79b2577a256..fc67c6f92b5 100644 --- a/manager/src/main/resources/define/app-hertzbeat.yml +++ b/manager/src/main/resources/define/app-hertzbeat.yml @@ -87,6 +87,9 @@ metrics: # the first metrics summary # attention: Built-in monitoring metrics contains (responseTime - Response time) - name: summary + i18n: + zh-CN: 概要信息 + en-US: Summary # metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel # priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue priority: 0 @@ -96,14 +99,29 @@ metrics: - field: app type: 1 label: true + i18n: + zh-CN: 应用 + en-US: App - field: category type: 1 + i18n: + zh-CN: 类别 + en-US: Category - field: status type: 0 + i18n: + zh-CN: 状态 + en-US: Status - field: size type: 0 + i18n: + zh-CN: 数量 + en-US: Size - field: availableSize type: 0 + i18n: + zh-CN: 可用数量 + en-US: Available Size # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here protocol: http # the config content when protocol is http @@ -132,19 +150,37 @@ metrics: parseScript: '$.data.apps.*' - name: inner_queue + i18n: + zh-CN: 内部队列 + en-US: Inner Queue priority: 1 fields: - field: responseTime type: 0 unit: ms + i18n: + zh-CN: 响应时间 + en-US: Response Time - field: alertDataQueue type: 0 + i18n: + zh-CN: 变更数据队列 + en-US: Data Change Queue - field: metricsDataToAlertQueue type: 0 + i18n: + zh-CN: 指标数据到变更队列 + en-US: Metrics Data to Change Queue - field: metricsDataToPersistentStorageQueue type: 0 + i18n: + zh-CN: 指标数据到持久化队列 + en-US: Metrics Data to Persistent Queue - field: metricsDataToMemoryStorageQueue type: 0 + i18n: + zh-CN: 指标数据到内存存储队列 + en-US: Metrics Data to Memory Storage Queue protocol: http http: host: ^_^host^_^ @@ -163,11 +199,17 @@ metrics: parseScript: '$.data' - name: thread_state + i18n: + zh-CN: 线程状态 + en-US: Thread State visible: false priority: 1 fields: - field: state type: 2 + i18n: + zh-CN: 状态 + en-US: State protocol: http http: host: ^_^host^_^ @@ -185,12 +227,21 @@ metrics: parseScript: '$.availableTags[?(@.tag == "state")].values[*]' - name: threads + i18n: + zh-CN: 线程 + en-US: Threads priority: 3 fields: - field: state type: 1 + i18n: + zh-CN: 状态 + en-US: State - field: number type: 0 + i18n: + zh-CN: 数量 + en-US: Number aliasFields: - $.measurements[?(@.statistic == "VALUE")].value calculates: @@ -213,11 +264,17 @@ metrics: parseScript: '$' - name: space_name + i18n: + zh-CN: 空间名称 + en-US: Space Name visible: false priority: 4 fields: - field: id type: 1 + i18n: + zh-CN: ID + en-US: ID protocol: http http: host: ^_^host^_^ @@ -235,13 +292,22 @@ metrics: parseScript: '$.availableTags[?(@.tag == "id")].values[*]' - name: memory_used + i18n: + zh-CN: 内存使用 + en-US: Memory Used priority: 5 fields: - field: space type: 1 + i18n: + zh-CN: 空间 + en-US: Space - field: mem_used type: 0 unit: MB + i18n: + zh-CN: 已使用内存 + en-US: Used Memory aliasFields: - $.measurements[?(@.statistic == "VALUE")].value calculates: diff --git a/manager/src/main/resources/define/app-hertzbeat_token.yml b/manager/src/main/resources/define/app-hertzbeat_token.yml index 1bbbf78825a..3c817b63370 100644 --- a/manager/src/main/resources/define/app-hertzbeat_token.yml +++ b/manager/src/main/resources/define/app-hertzbeat_token.yml @@ -78,6 +78,9 @@ params: metrics: # metrics - auth - name: auth + i18n: + zh-CN: 认证 + en-US: Auth # metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel # priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue priority: 0 @@ -86,8 +89,14 @@ metrics: # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: token type: 1 + i18n: + zh-CN: 令牌 + en-US: Token - field: refreshToken type: 1 + i18n: + zh-CN: 刷新令牌 + en-US: Refresh Token # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # the config content when protocol is http @@ -116,19 +125,37 @@ metrics: - name: summary + i18n: + zh-CN: 概要信息 + en-US: Summary priority: 1 fields: - field: app type: 1 label: true + i18n: + zh-CN: 应用 + en-US: App - field: category type: 1 + i18n: + zh-CN: 类别 + en-US: Category - field: status type: 0 + i18n: + zh-CN: 状态 + en-US: Status - field: size type: 0 + i18n: + zh-CN: 数量 + en-US: Size - field: availableSize type: 0 + i18n: + zh-CN: 可用数量 + en-US: Available Size protocol: http http: host: ^_^host^_^ @@ -144,19 +171,37 @@ metrics: parseScript: '$.data.apps.*' - name: inner_queue + i18n: + zh-CN: 内部队列 + en-US: Inner Queue priority: 1 fields: - field: responseTime type: 0 unit: ms + i18n: + zh-CN: 响应时间 + en-US: Response Time - field: alertDataQueue type: 0 + i18n: + zh-CN: 变更数据队列 + en-US: Alert Data Queue - field: metricsDataToAlertQueue type: 0 + i18n: + zh-CN: 指标数据到变更队列 + en-US: Metrics Data to Alert Queue - field: metricsDataToPersistentStorageQueue type: 0 + i18n: + zh-CN: 指标数据到持久化队列 + en-US: Metrics Data to Persistent Storage Queue - field: metricsDataToMemoryStorageQueue type: 0 + i18n: + zh-CN: 指标数据到内存存储队列 + en-US: Metrics Data to Memory Storage Queue protocol: http http: host: ^_^host^_^ @@ -173,11 +218,17 @@ metrics: parseScript: '$.data' - name: thread_state + i18n: + zh-CN: 指标数据到内存存储队列 + en-US: Metrics Data to Memory Storage Queue visible: false priority: 2 fields: - field: state type: 1 + i18n: + zh-CN: 状态 + en-US: State protocol: http http: host: ^_^host^_^ @@ -193,12 +244,21 @@ metrics: parseScript: '$.availableTags[?(@.tag == "state")].values[*]' - name: threads + i18n: + zh-CN: 线程 + en-US: Threads priority: 3 fields: - field: state type: 1 + i18n: + zh-CN: 状态 + en-US: State - field: number type: 0 + i18n: + zh-CN: 数量 + en-US: Number aliasFields: - $.measurements[?(@.statistic == "VALUE")].value calculates: @@ -219,11 +279,17 @@ metrics: parseScript: '$' - name: space_name + i18n: + zh-CN: 空间名称 + en-US: Space Name visible: false priority: 4 fields: - field: id type: 1 + i18n: + zh-CN: ID + en-US: ID protocol: http http: host: ^_^host^_^ @@ -239,13 +305,22 @@ metrics: parseScript: '$.availableTags[?(@.tag == "id")].values[*]' - name: memory_used + i18n: + zh-CN: 内存使用 + en-US: Memory Used priority: 5 fields: - field: space type: 1 + i18n: + zh-CN: 空间 + en-US: Space - field: mem_used type: 0 unit: MB + i18n: + zh-CN: 内存使用量 + en-US: Memory Used aliasFields: - $.measurements[?(@.statistic == "VALUE")].value calculates: