model

package
v0.0.0-...-3651c1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const BeatHistoryCount = 100

The number of beats that we save

View Source
const StateError = "error"

The service is in an error state

View Source
const StateMuted = "muted"

The service is muted

View Source
const StateNew = "new"

The service is new (this is an initial state from where it will transition quickly)

View Source
const StateOk = "ok"

The service is perfectly fine

View Source
const TIMEOUT_AUTO int64 = -2
View Source
const TIMEOUT_CLEAR int64 = -1

Special values for error and warning timeouts

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Name            string   `json:"name"`              // Name of the alarm
	State           string   `json:"state"`             // One of the StateXX constant
	IncidentNbr     int      `json:"incident_nbr"`      // Incrementing number everytime the alarm leaves the StateOk state
	FailedServices  []string `json:"failed_services"`   // A list of failed services, if any. This list may be trimmed.
	LastStateChange int64    `json:"last_state_change"` // Time when the alarm last changed state
}

Alarm contains a number of services and trigger alerts when it's not OK.

type Beat

type Beat struct {
}

type DeleteAlarm

type DeleteAlarm struct {
}

type DeleteService

type DeleteService struct {
}

type MuteService

type MuteService struct {
	Muted bool `json:"muted"`
}

type Service

type Service struct {
	Name            string   `json:"name"`                   // Name of the service
	LastBeat        int64    `json:"last_beat"`              // Timestamp, in milliseconds since epoch, of last beat
	BeatHistory     []int64  `json:"beat_history,omitempty"` // The last X duration (in milliseconds) between heartbeats
	Timeout         int64    `json:"timeout"`                // The timeout, in milliseconds
	State           string   `json:"state"`                  // One of the StateXX constants
	MutedSince      int64    `json:"muted_since"`            // Since when this service has been muted (if >0)
	LastStateChange int64    `json:"last_state_change"`      // Time when the service last changed state
	InAlarms        []string `json:"in_alarms,omitempty"`    // A list of alarms this service is included in
}

Service is something that can issue a beat

type SetTimeout

type SetTimeout struct {
	Timeout int64 `json:"timeout"`
}

type Tick

type Tick struct {
}

type Update

type Update struct {
	Ts int64 `json:"ts"`

	Tick *Tick `json:"tick,omitempty"`

	Service       string         `json:"service,omitempty"`
	Beat          *Beat          `json:"beat,omitempty"`
	SetTimeout    *SetTimeout    `json:"set_timeout,omitempty"`
	MuteService   *MuteService   `json:"mute_service,omitempty"`
	DeleteService *DeleteService `json:"delete_service,omitempty"`

	Alarm       string       `json:"alarm,omitempty"`
	DeleteAlarm *DeleteAlarm `json:"delete_alarm,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL