元数据
- group DCGMAPI_METADATA
本章介绍查询 DCGM 元数据的方法。
函数
-
dcgmReturn_t dcgmIntrospectGetHostengineMemoryUsage(dcgmHandle_t pDcgmHandle, dcgmIntrospectMemory_t *memoryInfo, int waitIfNoData)
检索主机引擎进程当前正在使用的总内存量。
此测量值表示常驻集大小(当前在 RAM 中的大小)和属于该进程的交换内存。
- 参数:
pDcgmHandle – IN: DCGM 句柄
memoryInfo – IN/OUT: 请参阅 dcgmIntrospectMemory_t。在此调用之前,memoryInfo->version 必须设置为 dcgmIntrospectMemory_version。
waitIfNoData – IN: 如果未收集到元数据,则等待直到发生这种情况 (!0) 或返回 DCGM_ST_NO_DATA (0)
- 返回值:
DCGM_ST_OK 如果调用成功
DCGM_ST_NOT_CONFIGURED 如果元数据收集状态为DCGM_INTROSPECT_STATE_DISABLED
DCGM_ST_NO_DATA 如果 waitIfNoData 为 false 且尚未收集元数据
DCGM_ST_VER_MISMATCH 如果 memoryInfo->version 为 0 或无效。
-
dcgmReturn_t dcgmIntrospectGetHostengineCpuUtilization(dcgmHandle_t pDcgmHandle, dcgmIntrospectCpuUtil_t *cpuUtil, int waitIfNoData)
检索 DCGM 主机引擎进程的 CPU 利用率。
- 参数:
pDcgmHandle – IN: DCGM 句柄
cpuUtil – IN/OUT: 请参阅 dcgmIntrospectCpuUtil_t。在此调用之前,cpuUtil->version 必须设置为 dcgmIntrospectCpuUtil_version。
waitIfNoData – IN: 如果未收集到元数据,则等待直到发生这种情况 (!0) 或返回 DCGM_ST_NO_DATA (0)
- 返回值:
DCGM_ST_OK 如果调用成功
DCGM_ST_NOT_CONFIGURED 如果元数据收集状态为DCGM_INTROSPECT_STATE_DISABLED
DCGM_ST_NO_DATA 如果 waitIfNoData 为 false 且尚未收集元数据
DCGM_ST_VER_MISMATCH 如果 cpuUtil->version 或 execTime->version 为 0 或无效。
-
dcgmReturn_t dcgmIntrospectGetHostengineMemoryUsage(dcgmHandle_t pDcgmHandle, dcgmIntrospectMemory_t *memoryInfo, int waitIfNoData)