Skip to content

Commit 1ef9925

Browse files
thampiotrwildum
authored andcommitted
remove unused function with issues on freeBSD
1 parent 7423ab0 commit 1ef9925

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

collector/zfs_freebsd.go

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
package collector
1818

1919
import (
20-
"fmt"
2120
"log/slog"
22-
"strings"
2321

2422
"github.com/prometheus/client_golang/prometheus"
25-
26-
"golang.org/x/sys/unix"
2723
)
2824

2925
type zfsCollector struct {
@@ -320,42 +316,3 @@ func (c *zfsCollector) Update(ch chan<- prometheus.Metric) error {
320316

321317
return nil
322318
}
323-
324-
func (c *zfsCollector) parseFreeBSDPoolObjsetStats() error {
325-
326-
sysCtlMetrics := []string{
327-
"nunlinked", "nunlinks", "nread", "reads", "nwritten", "writes",
328-
}
329-
zfsPoolMibPrefix := "kstat.zfs.pool.dataset"
330-
zfsDatasetsNames := []string{}
331-
332-
zfsDatasets, err := unix.Sysctl(zfsPoolMibPrefix)
333-
if err != nil {
334-
return fmt.Errorf("couldn't get sysctl: %w", err)
335-
}
336-
337-
for dataset, _ := range zfsDatasets {
338-
if strings.HasSuffix(dataset, ".dataset_name") {
339-
zfsDatasetsNames = append(zfsDatasetsNames, strings.SplitAfter(dataset, ".")[3])
340-
}
341-
}
342-
343-
for _, zpoolDataset := range zfsDatasetsNames {
344-
zfsDatasetLabels := map[string]string{
345-
"dataset": zpoolDataset,
346-
"zpool": strings.SplitAfter(zpoolDataset, "/")[0],
347-
}
348-
for metric := range sysCtlMetrics {
349-
c.sysctls = append(c.sysctls, bsdSysctl{
350-
name: fmt.SprintF("node_zfs_zpool_dataset_%s", metric),
351-
description: fmt.SprintF("node_zfs_zpool_dataset_%s", metric),
352-
mib: fmt.Sprintf("%s.%s.%s", zfsPoolMibPrefix, poolObj, metric),
353-
dataType: bsdSysctlTypeUint64,
354-
valueType: prometheus.CounterValue,
355-
labels: zfsDatasetLabels,
356-
})
357-
}
358-
}
359-
360-
return nil
361-
}

0 commit comments

Comments
 (0)