mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-11 07:26:37 +00:00
*: cleanup collector API 1 (#1547)
This commit is contained in:
@@ -8,14 +8,13 @@ import (
|
||||
"github.com/alecthomas/kingpin/v2"
|
||||
"github.com/go-kit/log"
|
||||
"github.com/prometheus-community/windows_exporter/pkg/collector"
|
||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func FuncBenchmarkCollector(b *testing.B, name string, collectFunc types.CollectorBuilderWithFlags) {
|
||||
func FuncBenchmarkCollector[C collector.Collector](b *testing.B, name string, collectFunc collector.BuilderWithFlags[C]) {
|
||||
c := collectFunc(kingpin.CommandLine)
|
||||
collectors := collector.New(map[string]types.Collector{name: c})
|
||||
collectors := collector.New(map[string]collector.Collector{name: c})
|
||||
require.NoError(b, collectors.Build())
|
||||
collectors.SetLogger(log.NewNopLogger())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user