dorametrics

package
v0.0.0-...-708f18f Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCollectors

func RegisterCollectors(collectors *Collectors, dryrun bool) error

Types

type Collectors

type Collectors struct {
	CycleTimeGauge      prometheus.GaugeVec
	TimeToRecoveryGauge prometheus.GaugeVec
	SuccessCounter      prometheus.CounterVec
	FailureCounter      prometheus.CounterVec
	DowntimeCounter     prometheus.CounterVec
}

type Controller

type Controller struct {
	Indexer    cache.Indexer
	Queue      workqueue.RateLimitingInterface
	Informer   cache.Controller
	Clientset  kubernetes.Interface
	Mutex      *sync.Mutex
	State      map[string]DeploymentInfo // map[NAMESPACE:NAME]DeploymentInfo
	Dedup      map[string]string         // map[NAMESPACE:NAME]REPORT_BEFORE
	Debug      bool
	Collectors *Collectors
}

Controller represents the controller state

func NewController

func NewController(
	queue workqueue.RateLimitingInterface,
	indexer cache.Indexer,
	informer cache.Controller,
	clientset kubernetes.Interface,
	mutex *sync.Mutex,
	state map[string]DeploymentInfo,
	dedup map[string]string,
	debug bool,
	collectors *Collectors) *Controller

NewController constructs the central controller state

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh chan struct{})

Run manages the controller lifecycle

type ControllerConfig

type ControllerConfig struct {
	Targets []Target `json:"deployments"`
	Stage   string   `json:"stage"`
}

type DeploymentInfo

type DeploymentInfo struct {
	Name          string `json:"name"`
	Namespace     string `json:"namespace"`
	Replicas      int32  `json:"replicas"`
	ReadyReplicas int32  `json:"readyReplicas"`
	ErrorStart    int64  `json:"errorStart"`
}

DeploymentInfo captures the information written to stdout

type Incident

type Incident struct {
	Type    string  `json:"type"`
	Title   string  `json:"title"`
	Service Service `json:"service"`
}

type Payload

type Payload struct {
	Incident Incident `json:"incident"`
}

type Service

type Service struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

type Target

type Target struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Team      string `json:"team"`
	Alert     bool
}

Jump to

Keyboard shortcuts

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