summaryrefslogtreecommitdiff
path: root/plugins/metrics/tests/plugin1.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/metrics/tests/plugin1.go')
-rw-r--r--plugins/metrics/tests/plugin1.go69
1 files changed, 2 insertions, 67 deletions
diff --git a/plugins/metrics/tests/plugin1.go b/plugins/metrics/tests/plugin1.go
index 8f1ece52..fb2a2235 100644
--- a/plugins/metrics/tests/plugin1.go
+++ b/plugins/metrics/tests/plugin1.go
@@ -28,77 +28,12 @@ func (p1 *Plugin1) Name() string {
return "metrics_test.plugin1"
}
-func (p1 *Plugin1) MetricsCollector() prometheus.Collector {
+func (p1 *Plugin1) MetricsCollector() []prometheus.Collector {
collector := prometheus.NewGauge(prometheus.GaugeOpts{
Name: "my_gauge",
Help: "My gauge value",
})
collector.Set(100)
- return collector
-}
-
-// //////////////////////////////////////////////////////////////
-type Plugin3 struct {
- config config.Configurer
-}
-
-func (p *Plugin3) Init(cfg config.Configurer) error {
- p.config = cfg
- return nil
-}
-
-func (p *Plugin3) Serve() chan error {
- errCh := make(chan error, 1)
- return errCh
-}
-
-func (p *Plugin3) Stop() error {
- return nil
-}
-
-func (p *Plugin3) Name() string {
- return "metrics_test.plugin3"
-}
-
-func (p *Plugin3) MetricsCollector() prometheus.Collector {
- var (
- cpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{
- Name: "cpu_temperature_celsius",
- Help: "Current temperature of the CPU.",
- })
- )
- return cpuTemp
-}
-
-type Plugin4 struct {
- config config.Configurer
-}
-
-func (p *Plugin4) Init(cfg config.Configurer) error {
- p.config = cfg
- return nil
-}
-
-func (p *Plugin4) Serve() chan error {
- errCh := make(chan error, 1)
- return errCh
-}
-
-func (p *Plugin4) Stop() error {
- return nil
-}
-
-func (p *Plugin4) Name() string {
- return "metrics_test.plugin4"
-}
-
-func (p *Plugin4) MetricsCollector() prometheus.Collector {
- var (
- cpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{
- Name: "cpu_temperature_celsius",
- Help: "Current temperature of the CPU.",
- })
- )
- return cpuTemp
+ return []prometheus.Collector{collector}
}