Replaced stringArrayContains by slices.Contains

This commit is contained in:
Holger Obermaier
2026-02-06 13:49:39 +01:00
parent 1f7b13349c
commit 2b5bf4d6a5
13 changed files with 45 additions and 48 deletions

View File

@@ -17,6 +17,7 @@ import (
"os/exec"
"os/user"
"regexp"
"slices"
"strconv"
"strings"
"time"
@@ -73,8 +74,7 @@ func (m *BeegfsStorageCollector) Init(config json.RawMessage) error {
//create map with possible variables
m.matches = make(map[string]string)
for _, value := range storageStat_array {
_, skip := stringArrayContains(m.config.ExcludeMetrics, value)
if skip {
if slices.Contains(m.config.ExcludeMetrics, value) {
m.matches["other"] = "0"
} else {
m.matches["beegfs_cstorage_"+value] = "0"