You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use cvmfs_talk metrics prometheus when possible (#5)
The script that gathers the repo information scales not so well with the number of repositories mounted on a machine. On my machine with 21 repos mounted, it takes about 13s. This PR takes it down to 2.5s by doing the following
* Use the new `cvmfs_talk metrics prometheus` command when possible. This gathers all of the metrics (except maxfd, which is awkward to get in talk) in one batched operation, removing the overhead of repeated calls to cvmfs_talk
* Getting the list of mounted repos via cvmfs_config status is a surprisingly slow operation. I bypass this to just parse findmnt and assume all repos are mounted under their name in /cvmfs . There's an option to use the old behavior in case you use non-standard mountpoints. For a future release of cvmfs I think I'll fix this properly by exposing the repository name as a subtype.
As a bonus, this pr includes a bugfix: the `expires` magic xattr can have the non-numeric value `never (fixed root catalog)` when mounting the repo with `CVMFS_ROOT_HASH` set. The script would throw an error in this case. I change the metric to show -1 if the catalog never expires (not sure if that's the idiomatic choice or 0 is preferred).
generate_metric 'cvmfs_repo_expires_seconds''gauge''Shows the remaining life time of the mounted root file catalog in seconds.'"repo=\"${fqrn}\"""${cvmfs_repo_expires}"
generate_metric 'cvmfs_repo_expires_seconds''gauge''Shows the remaining life time of the mounted root file catalog in seconds. -1 if never expires.'"repo=\"${fqrn}\"""${cvmfs_repo_expires}"
0 commit comments