Skip to content

Commit 42eec4d

Browse files
authored
[improve] Improvements to NVIDIA's monitoring history charts are not displayed (#4123)
1 parent e57d617 commit 42eec4d

2 files changed

Lines changed: 38 additions & 77 deletions

File tree

hertzbeat-manager/src/main/resources/define/app-nvidia.yml

Lines changed: 24 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -208,77 +208,6 @@ params:
208208
required: false
209209
# hide param-true or false
210210
hide: true
211-
# field-param field key
212-
- field: proxyHost
213-
# name-param field display i18n name
214-
name:
215-
zh-CN: 代理主机
216-
en-US: Proxy Host
217-
ja-JP: プロキシホスト
218-
# type-param field type(most mapping the html input type)
219-
type: text
220-
# required-true or false
221-
required: false
222-
# hide param-true or false
223-
hide: true
224-
- field: proxyPort
225-
# name-param field display i18n name
226-
name:
227-
zh-CN: 代理端口
228-
en-US: Proxy Port
229-
ja-JP: プロキシポート
230-
# type-param field type(most mapping the html input type)
231-
type: number
232-
# when type is number, range is required
233-
range: '[0,65535]'
234-
# required-true or false
235-
required: false
236-
# hide param-true or false
237-
hide: true
238-
# default value
239-
defaultValue: 22
240-
# field-param field key
241-
- field: proxyUsername
242-
# name-param field display i18n name
243-
name:
244-
zh-CN: 代理用户名
245-
en-US: Proxy Username
246-
ja-JP: プロキシユーザー名
247-
# type-param field type(most mapping the html input type)
248-
type: text
249-
# when type is text, use limit to limit string length
250-
limit: 50
251-
# required-true or false
252-
required: false
253-
# hide param-true or false
254-
hide: true
255-
# field-param field key
256-
- field: proxyPassword
257-
# name-param field display i18n name
258-
name:
259-
zh-CN: 代理密码
260-
en-US: Proxy Password
261-
ja-JP: プロキシパスワード
262-
# type-param field type(most mapping the html input tag)
263-
type: password
264-
# required-true or false
265-
required: false
266-
# hide param-true or false
267-
hide: true
268-
# field-param field key
269-
- field: proxyPrivateKey
270-
# name-param field display i18n name
271-
name:
272-
zh-CN: 代理主机私钥
273-
en-US: proxyPrivateKey
274-
ja-JP: プロキシ秘密鍵
275-
# type-param field type(most mapping the html input type)
276-
type: textarea
277-
placeholder: -----BEGIN RSA PRIVATE KEY-----
278-
# required-true or false
279-
required: false
280-
# hide param-true or false
281-
hide: true
282211
# collect metrics config list
283212
metrics:
284213
# metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -306,48 +235,66 @@ metrics:
306235
zh-CN: 显卡名称
307236
en-US: System Version
308237
ja-JP: 名前
309-
- field: utilization.gpu [%]
238+
- field: utilization_gpu
310239
type: 0
311240
unit: '%'
312241
i18n:
313242
zh-CN: GPU利用率
314243
en-US: GPU Utilization
315244
ja-JP: GPU使用率
316-
- field: utilization.memory [%]
245+
- field: utilization_memory
317246
type: 0
318247
unit: '%'
319248
i18n:
320249
zh-CN: 显存利用率
321250
en-US: Memory Utilization
322251
ja-JP: メモリ使用率
323-
- field: memory.total [MiB]
252+
- field: memory_total
324253
type: 1
325254
unit: 'MiB'
326255
i18n:
327256
zh-CN: 总显存
328257
en-US: Total Memory
329258
ja-JP: メモリ容量
330-
- field: memory.used [MiB]
259+
- field: memory_used
331260
type: 0
332261
unit: 'MiB'
333262
i18n:
334263
zh-CN: 已用显存
335264
en-US: Used Memory
336265
ja-JP: 使用したメモリ
337-
- field: memory.free [MiB]
266+
- field: memory_free
338267
type: 0
339268
unit: 'MiB'
340269
i18n:
341270
zh-CN: 空闲显存
342271
en-US: Free Memory
343272
ja-JP: 利用可能メモリ
344-
- field: temperature.gpu
273+
- field: temperature_gpu
345274
type: 1
346275
unit: '°C'
347276
i18n:
348277
zh-CN: 显卡温度
349278
en-US: GPU Temperature
350279
ja-JP: GPU温度
280+
aliasFields:
281+
- index
282+
- name
283+
- utilization.gpu [%]
284+
- utilization.memory [%]
285+
- memory.total [MiB]
286+
- memory.used [MiB]
287+
- memory.free [MiB]
288+
- temperature_gpu
289+
calculates:
290+
- index
291+
- name
292+
- utilization_gpu = utilization.gpu [%]
293+
- utilization_memory = utilization.memory [%]
294+
- memory_total = memory.total [MiB]
295+
- memory_used = memory.used [MiB]
296+
- memory_free = memory.free [MiB]
297+
- temperature_gpu = temperature.gpu
351298
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
352299
protocol: ssh
353300
# the config content when protocol is ssh

hertzbeat-manager/src/test/java/org/apache/hertzbeat/manager/service/AppServiceTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.util.Collections;
4444
import java.util.List;
4545
import java.util.Map;
46+
import java.util.stream.Collectors;
4647

4748
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
4849
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -84,6 +85,19 @@ void getAppParamDefines() {
8485
assertDoesNotThrow(() -> appService.getAppParamDefines("jvm"));
8586
}
8687

88+
@Test
89+
void getAppParamDefinesShouldNotContainDuplicateFields() {
90+
List<ParamDefineInfo> paramDefines = appService.getAppParamDefines("nvidia");
91+
Map<String, Long> fieldCounts = paramDefines.stream()
92+
.collect(Collectors.groupingBy(ParamDefineInfo::getField, Collectors.counting()));
93+
94+
assertTrue(fieldCounts.values().stream().allMatch(count -> count == 1),
95+
() -> "Duplicate param fields found: " + fieldCounts.entrySet().stream()
96+
.filter(entry -> entry.getValue() > 1)
97+
.map(Map.Entry::getKey)
98+
.collect(Collectors.joining(", ")));
99+
}
100+
87101
@Test
88102
void getAppDefine() {
89103
assertDoesNotThrow(() -> appService.getAppDefine("jvm"));

0 commit comments

Comments
 (0)