Skip to content
Snippets Groups Projects
Commit f039320f authored by František Řezníček's avatar František Řezníček
Browse files

fix: gpumon generates at least a metric help (metric-generator-exec.sh requirement)

parent 0c31fcab
No related branches found
No related tags found
No related merge requests found
Pipeline #161338 passed
...@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [1.2.3] - 2022-06-07
### Added
- gpumon: publish at least a metric help (metric-generator-exec requirement)
- metric-generator-exec.sh: added note on how should generator module behave
## [1.2.2] - 2022-06-07 ## [1.2.2] - 2022-06-07
### Added ### Added
- gpumon: avoid crashing on no GPU (readlink) - gpumon: avoid crashing on no GPU (readlink)
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
# * <metrics-generator-output-textfile-metric-file> generated by the <metric-generator-module-name> # * <metrics-generator-output-textfile-metric-file> generated by the <metric-generator-module-name>
# * <runner-output-textfile-metric-file> generated by this runner (measuring <metric-generator-module-name> is successfully executed) # * <runner-output-textfile-metric-file> generated by this runner (measuring <metric-generator-module-name> is successfully executed)
# #
# Requirements:
# 1. CMG module has to exit with ecode of 0
# 2. CMG module has to produce metrics on stdout (empty stdout is also invalid, generate at least metric help comments)
#
# Examples: # Examples:
# # launch `smartmon` metric generator module # # launch `smartmon` metric generator module
# $ metric-generator-exec.sh smartmon /tmp/smartmon.prom /tmp/cmg-smartmon.prom # $ metric-generator-exec.sh smartmon /tmp/smartmon.prom /tmp/cmg-smartmon.prom
......
...@@ -56,12 +56,13 @@ fi ...@@ -56,12 +56,13 @@ fi
# browse the GPUs and export metrics # browse the GPUs and export metrics
METRIC_NAME="gpumon_device_state_code" METRIC_NAME="gpumon_device_state_code"
STAGE_NAME="GPU devices ${METRIC_NAME} metrics generated" STAGE_NAME="GPU devices ${METRIC_NAME} metric[s] documentation generated"
get_metric_help "${METRIC_NAME}" "gauge" "GPU device state code (0/1 ~ available free/unavailable used)."
STAGE_NAME="GPU devices ${METRIC_NAME} metric[s] time-series generated"
if [ -n "${GPU_DEVICES}" ]; then if [ -n "${GPU_DEVICES}" ]; then
get_metric_help "${METRIC_NAME}" "gauge" "GPU device state code (0/1 ~ available free/unavailable used)."
echo "${GPU_DEVICES}" | \ echo "${GPU_DEVICES}" | \
while read i_gpu_device ; do while read i_gpu_device ; do
STAGE_NAME="GPU device ${METRIC_NAME} metrics generated (${i_gpu_device})" STAGE_NAME="GPU device ${METRIC_NAME} metric time-series generated (${i_gpu_device})"
[ -z "${i_gpu_device}" ] && \ [ -z "${i_gpu_device}" ] && \
continue continue
i_gpu_device_location="$(echo "${i_gpu_device}" | awk '{printf $1}')" i_gpu_device_location="$(echo "${i_gpu_device}" | awk '{printf $1}')"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment