Documentation
¶
Index ¶
- Variables
- func Cleanup(s Status)
- type Availability
- type Config
- type EvtGroup
- type Group
- func (g *Group) Add(c Grouper)
- func (g Group) Availability() Availability
- func (g Group) GetCounter(counter string) float64
- func (g Group) Key() string
- func (g Group) Level() Level
- func (g Group) LevelRedundent() Level
- func (g Group) MarshalJSON() ([]byte, error)
- func (Group) New(k string) Grouper
- func (g *Group) SetConfig(cfg *Config)
- func (g *Group) UnmarshalJSON(data []byte) error
- type Grouper
- type Level
- type RegionGroup
- type Status
- type SzenarioGroup
- type UserGroup
Constants ¶
This section is empty.
Variables ¶
var GrpReg *grpReg = &grpReg{ grps: map[string]Grouper{}, }
GrpReg holds all by json instanceble groups
Functions ¶
Types ¶
type Availability ¶
type Availability float64
Availability is the availability of a group given in % from 0 to 1
func (Availability) String ¶
func (ga Availability) String() string
type EvtGroup ¶
type EvtGroup interface {
Grouper
AddEvent(evt *msg.SzenarioEvtMsg)
}
EvtGroup is a status group containing events
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is the implementation of a generic alert group
func (Group) Availability ¶
func (g Group) Availability() Availability
Availability is the availability of a group given in % from 0 to 1
func (Group) GetCounter ¶ added in v0.10.4
GetCounter returns the avg of a counter
func (Group) LevelRedundent ¶
LevelRedundent returns the error level of a redanent set
func (Group) MarshalJSON ¶
MarshalJSON marshall children
func (*Group) UnmarshalJSON ¶
UnmarshalJSON marshall children
type Grouper ¶
type Grouper interface {
New(k string) Grouper
Key() string
Level() Level
Availability() Availability
GetCounter(string) float64
Add(Grouper)
SetConfig(*Config)
json.Marshaler
json.Unmarshaler
}
Grouper is the alert group interface
type Level ¶
type Level int
Level is the serverity level of a state
const ( // Unknown indicates that no information is availabler Unknown Level = iota // OK indicates OK (or if an event at least the last event was OK) OK // Issues indicates that some states where not OK Issues // Warning indicates that most states where not OK Warning // Down indicates that all (or at least a lot) states where DOWN Down )
func (Level) FromString ¶
FromString converts string to Level or panics
func (*Level) UnmarshalGQL ¶
UnmarshalGQL for graphql
type RegionGroup ¶
type RegionGroup interface {
Grouper
String() string
StringInt(int) string
AddEvent(evt *msg.SzenarioEvtMsg)
Users() []UserGroup
LastUpdate() time.Time
LastTotal() float64
Totals() []float64
}
RegionGroup correlates event messages
type Status ¶
type Status interface {
Grouper
String() string
StringInt(int) string
AddEvent(evt *msg.SzenarioEvtMsg)
Szenarios() []SzenarioGroup
Get(string) SzenarioGroup
LastUpdate() time.Time
JSONBySzenario(string) []byte
UpdatePrometheus()
}
Status correlates event messages
type SzenarioGroup ¶
type SzenarioGroup interface {
Grouper
String() string
StringInt(int) string
AddEvent(evt *msg.SzenarioEvtMsg)
Regions() []RegionGroup
LastUpdate() time.Time
LastTotal() float64
Totals() []float64
}
SzenarioGroup correlates event messages