Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeNumber = iota TypePercentage )
View Source
const ( JUnitID = "junit" ServiceID = "service" MethodWorst = "worst" MethodInherited = "inherited" MethodDependencies = "dependencies" CalculationMethodNumber = "number" CalculationCondGT = "gt" CalculationCondLT = "lt" RuleTypeComponent = "component" RuleTypeService = "service" StateSettingsNotificationID = "state_settings_notify_id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
Get(ctx context.Context, settingID string) (*StateSetting, error)
}
func NewMongoAdapter ¶
type Assigner ¶
type JUnitThreshold ¶
type JUnitThreshold struct { Minor float64 `bson:"minor"` Major float64 `bson:"major"` Critical float64 `bson:"critical"` Type int `bson:"type"` }
func (JUnitThreshold) GetState ¶
func (s JUnitThreshold) GetState(value, total int64) int
type JUnitThresholds ¶
type JUnitThresholds struct { Skipped JUnitThreshold `bson:"skipped"` Errors JUnitThreshold `bson:"errors"` Failures JUnitThreshold `bson:"failures"` }
func (JUnitThresholds) GetState ¶
func (s JUnitThresholds) GetState(skipped, errors, failures, total int64) int
type Listener ¶
type Listener interface {
Listen(ctx context.Context, ch <-chan RuleUpdatedMessage)
}
type RuleChangesWatcher ¶
func NewRulesChangesWatcher ¶
func NewRulesChangesWatcher(client mongo.DbClient, service Assigner) RuleChangesWatcher
type RuleUpdatedMessage ¶
type StateSetting ¶
type StateSetting struct { ID string `bson:"_id"` Title string `bson:"title"` Method string `bson:"method"` Enabled *bool `bson:"enabled,omitempty"` Priority int64 `bson:"priority"` Type string `bson:"type,omitempty"` EntityPattern *pattern.Entity `bson:"entity_pattern,omitempty"` InheritedEntityPattern *pattern.Entity `bson:"inherited_entity_pattern,omitempty"` JUnitThresholds *JUnitThresholds `bson:"junit_thresholds,omitempty"` StateThresholds *StateThresholds `bson:"state_thresholds,omitempty"` }
func DefaultWorst ¶
func DefaultWorst() StateSetting
type StateThreshold ¶
type StateThreshold struct { Method string `bson:"method"` State string `bson:"state"` Cond string `bson:"cond"` Value int `bson:"value"` }
func (*StateThreshold) IsReached ¶
func (s *StateThreshold) IsReached(c Counters) bool
type StateThresholds ¶
type StateThresholds struct { Critical *StateThreshold `bson:"critical,omitempty"` Major *StateThreshold `bson:"major,omitempty"` Minor *StateThreshold `bson:"minor,omitempty"` OK *StateThreshold `bson:"ok,omitempty"` }
Click to show internal directories.
Click to hide internal directories.