zfs: move common init function out of arch-specific files

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
This commit is contained in:
Daniel Swarbrick 2024-05-12 18:25:06 +02:00 committed by Johannes 'fish' Ziemke
parent fafc973e94
commit 8ea822f67a
4 changed files with 4 additions and 12 deletions

View File

@ -15,3 +15,7 @@
// +build !nozfs
package collector
func init() {
registerCollector("zfs", defaultEnabled, NewZFSCollector)
}

View File

@ -30,10 +30,6 @@ const (
zfsCollectorSubsystem = "zfs"
)
func init() {
registerCollector("zfs", defaultEnabled, NewZfsCollector)
}
func NewZfsCollector(logger *slog.Logger) (Collector, error) {
return &zfsCollector{
sysctls: []bsdSysctl{

View File

@ -58,10 +58,6 @@ type zfsCollector struct {
logger *slog.Logger
}
func init() {
registerCollector("zfs", defaultEnabled, NewZFSCollector)
}
// NewZFSCollector returns a new Collector exposing ZFS statistics.
func NewZFSCollector(logger *slog.Logger) (Collector, error) {
return &zfsCollector{

View File

@ -61,10 +61,6 @@ const (
zfsCollectorSubsystem = "zfs"
)
func init() {
registerCollector("zfs", defaultEnabled, NewZfsCollector)
}
func NewZfsCollector(logger *slog.Logger) (Collector, error) {
return &zfsCollector{
abdstatsLinearCount: prometheus.NewDesc(