-
Notifications
You must be signed in to change notification settings - Fork 1
/
storage.go
36 lines (31 loc) · 959 Bytes
/
storage.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
package monitor
import (
"time"
)
// MetricUpdater increments data metric
type MetricUpdater interface {
RegisterApplication(appInfo *ApplicationInfo) error
DeregisterApplication() error
ReceiveEvent(event EventType) error
ExecuteTask(event EventType, execTime time.Duration) error
ExecuteFailoverTask(event EventType, execTime time.Duration) error
}
// MetricReader of information
type MetricReader interface {
ApplicationInfo() *ApplicationInfo
ReceiveCount() (uint64, error)
TaskInfo(name string) (*TaskInfo, error)
FailoverTaskInfo(name string) (*TaskInfo, error)
}
// Storage data accessor for monitoring
type Storage interface {
MetricUpdater
MetricReader
}
// ClusterInfoReader provides methods of information reading
type ClusterInfoReader interface {
ApplicationInfo() (*ApplicationInfo, error)
TaskInfo(name string) (*TaskInfo, error)
TaskInfoByID(id string) (*TaskInfo, error)
ListOfNodes() (map[string][]string, int, error)
}