Skip to content

Commit 9bb23fb

Browse files
authored
More efficient mountpoint extraction #7
Also fixes #4 , this was due to the maxfd metric that wasn't properly getting the mountpoint to find the xattr
1 parent f698903 commit 9bb23fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cvmfs-client-prometheus.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ mountpoint_for_cvmfs_repo() {
6565
cvmfs_talk -i "${reponame}" mountpoint
6666
}
6767

68+
mountpoint_for_cvmfs_repo_standard() {
69+
echo "/cvmfs/${reponame}"
70+
}
71+
6872
fqrn_for_cvmfs_repo() {
6973
local reponame
7074
reponame="$1"
@@ -130,7 +134,7 @@ get_cvmfs_repo_metrics() {
130134
reponame="$1"
131135

132136
local repomountpoint
133-
repomountpoint=$(mountpoint_for_cvmfs_repo "${reponame}")
137+
repomountpoint=$($MOUNTPOINT_FUNCTION "${reponame}")
134138

135139
local fqrn
136140
fqrn=$(fqrn_for_cvmfs_repo "${reponame}")
@@ -247,7 +251,7 @@ get_cvmfs_repo_metrics_new() {
247251
reponame="$1"
248252

249253
local repomountpoint
250-
repomountpoint=$(mountpoint_for_cvmfs_repo "${reponame}")
254+
repomountpoint=$($MOUNTPOINT_FUNCTION "${reponame}")
251255

252256
# Use the new "metrics prometheus" command to get most metrics
253257
cvmfs_talk -i "${reponame}" "metrics prometheus" >> "${TMPFILE}"
@@ -353,8 +357,10 @@ fi
353357
# Get repository list based on selected method
354358
if [[ "${USE_NON_STANDARD_MOUNTPOINTS}" == 'TRUE' ]]; then
355359
REPO_LIST=$(get_repos_from_cvmfs_config)
360+
MOUNTPOINT_FUNCTION="mountpoint_for_cvmfs_repo"
356361
else
357362
REPO_LIST=$(get_repos_from_findmnt)
363+
MOUNTPOINT_FUNCTION="mountpoint_for_cvmfs_repo_standard"
358364
fi
359365

360366
for REPO in $REPO_LIST; do

0 commit comments

Comments
 (0)