-
Notifications
You must be signed in to change notification settings - Fork 487
/
noop.go
43 lines (34 loc) · 883 Bytes
/
noop.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package instance
import (
"context"
"github.com/prometheus/prometheus/scrape"
"github.com/prometheus/prometheus/storage"
)
// NoOpInstance implements the Instance interface in pkg/prom
// but does not do anything. Useful for tests.
type NoOpInstance struct{}
// Run implements Instance.
func (NoOpInstance) Run(ctx context.Context) error {
<-ctx.Done()
return nil
}
// Ready implements Instance.
func (NoOpInstance) Ready() bool {
return true
}
// Update implements Instance.
func (NoOpInstance) Update(_ Config) error {
return nil
}
// TargetsActive implements Instance.
func (NoOpInstance) TargetsActive() map[string][]*scrape.Target {
return nil
}
// StorageDirectory implements Instance.
func (NoOpInstance) StorageDirectory() string {
return ""
}
// Appender implements Instance
func (NoOpInstance) Appender(_ context.Context) storage.Appender {
return nil
}