diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0fecb14c5cf93c6f1f4704f3d5a8bafbe20165..c9c884a2307c870facd096918df3ae1aac4fedc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [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 ### Added - gpumon: avoid crashing on no GPU (readlink) diff --git a/src/metric-generator-exec.sh b/src/metric-generator-exec.sh index 5efe11a9e4610a05376c1a0c5e1f1ca1bf2d48bd..3adea22f13b249c96735546552ad82747925b446 100755 --- a/src/metric-generator-exec.sh +++ b/src/metric-generator-exec.sh @@ -9,6 +9,10 @@ # * <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) # +# 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: # # launch `smartmon` metric generator module # $ metric-generator-exec.sh smartmon /tmp/smartmon.prom /tmp/cmg-smartmon.prom diff --git a/src/metric-generators/gpumon.sh b/src/metric-generators/gpumon.sh index c2c8549dde15d5ab4a8771f4cc01c863a39aa2e4..2cfffaedfa56df35c1989e441c6f47340945f453 100755 --- a/src/metric-generators/gpumon.sh +++ b/src/metric-generators/gpumon.sh @@ -56,12 +56,13 @@ fi # browse the GPUs and export metrics 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 - get_metric_help "${METRIC_NAME}" "gauge" "GPU device state code (0/1 ~ available free/unavailable used)." echo "${GPU_DEVICES}" | \ 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}" ] && \ continue i_gpu_device_location="$(echo "${i_gpu_device}" | awk '{printf $1}')"