observe

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name string
	Live bool
}

Cluster represents a target cluster

type ClusterObserver

type ClusterObserver struct {
	// contains filtered or unexported fields
}

ClusterObserver observers a single target cluster

func (*ClusterObserver) Observe

func (o *ClusterObserver) Observe(ctx context.Context, namespace string) (*Observation, error)

Observe observes a single target cluster

type ConcurrentObserver

type ConcurrentObserver struct {
	// contains filtered or unexported fields
}

ConcurrentObserver combines results from multiple Observers, run concurrently. Work abandoned on first known error.

func (*ConcurrentObserver) Observe

func (o *ConcurrentObserver) Observe(ctx context.Context, namespace string) (*Observation, error)

Observe calls all child observers concurrently. It bails out when an error is encountered.

type DeploymentInfo

type DeploymentInfo struct {
	Desired IntStat
	Current IntStat
}

DeploymentInfo is release-relevent info about deployment status

type DeploymentInfoSet

type DeploymentInfoSet struct {
	Live    *DeploymentInfo
	Standby *DeploymentInfo
}

DeploymentInfoSet returns deployment info for Live and Standby clusters

func NewDeploymentInfoSet

func NewDeploymentInfoSet() *DeploymentInfoSet

NewDeploymentInfoSet returns a new DeploymentInfoSet

func (*DeploymentInfoSet) GetInfo

func (dis *DeploymentInfoSet) GetInfo(liveness bool) *DeploymentInfo

GetInfo returns Info based on liveness flag

type IntStat

type IntStat struct {
	Min   int32
	Max   int32
	Sum   int32
	Count int32
}

IntStat records int32 stats

func (*IntStat) Record

func (s *IntStat) Record(n int32)

Record updates IntStat with new information

type Observation

type Observation struct {
	ReplicaSets []replicaSet
}

Observation encapsulates observed deployment state for an app target

func (*Observation) Combine

func (o *Observation) Combine(other *Observation) *Observation

Combine merges two Observations into a new Observation

func (*Observation) Count

func (o *Observation) Count(liveness bool) int

Count returns the number of unique live or standby clusters included in an Observation

func (*Observation) InfoForTag

func (o *Observation) InfoForTag(tag string) *DeploymentInfoSet

InfoForTag returns a deployment info set for a particular tag

type Observer

type Observer interface {
	Observe(context.Context, string) (*Observation, error)
}

Observer returns an Observation for a namespace

func NewClusterObserver

func NewClusterObserver(cluster Cluster, cli client.Client, log logr.Logger) Observer

NewClusterObserver creates a ClusterObserver

func NewConcurrentObserver

func NewConcurrentObserver(observers []Observer, log logr.Logger) Observer

NewConcurrentObserver creates a ConcurrentObserver

Jump to

Keyboard shortcuts

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