Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
custom-metrics-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cloud
custom-metrics-generator
Commits
f039320f
Commit
f039320f
authored
3 years ago
by
František Řezníček
Browse files
Options
Downloads
Patches
Plain Diff
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
3 years ago
Stage: build-image
Stage: release-image
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+5
-0
5 additions, 0 deletions
CHANGELOG.md
src/metric-generator-exec.sh
+4
-0
4 additions, 0 deletions
src/metric-generator-exec.sh
src/metric-generators/gpumon.sh
+4
-3
4 additions, 3 deletions
src/metric-generators/gpumon.sh
with
13 additions
and
3 deletions
CHANGELOG.md
+
5
−
0
View file @
f039320f
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
src/metric-generator-exec.sh
+
4
−
0
View file @
f039320f
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/metric-generators/gpumon.sh
+
4
−
3
View file @
f039320f
...
@@ -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-serie
s 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}'
)
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment