Documentation
¶
Index ¶
Constants ¶
const ( // HeartBeatGraceSeconds is an added grace-period that a heartbeat signal has // to come back successfully. HeartBeatGraceSeconds int64 = 180 )
Variables ¶
var ( // Heartbeat global heartbeat variable Heartbeat = time.Now() // Healthy global health variable Healthy = true )
Functions ¶
Types ¶
type ClusterMetrics ¶
type ClusterMetrics struct {
ExcessNodes prometheus.Gauge
NumberOfNonTaintedNodes prometheus.Gauge
NumberOfNodes prometheus.Gauge
NumberOfPods prometheus.Gauge
UnschedulableNodes prometheus.Gauge
CPUUtilization prometheus.Gauge
RAMUtilization prometheus.Gauge
}
ClusterMetrics is struct of prometheus metrics to be exported
func InitClusterMetrics ¶
func InitClusterMetrics(prefix string) *ClusterMetrics
InitClusterMetrics initializes these metrics
func (*ClusterMetrics) PublishClusterMetrics ¶
func (cm *ClusterMetrics) PublishClusterMetrics(clusterState *types.ClusterManifest)
PublishClusterMetrics updates the exported metrics
func (*ClusterMetrics) PublishNodeUnschedulable ¶
func (cm *ClusterMetrics) PublishNodeUnschedulable(nodesMap map[string]types.NodeManifest)
PublishNodeUnschedulable updates the number of unschedulable nodes
type DrainerMetrics ¶
type DrainerMetrics struct {
// Drainer Metrics
NodesCordoned prometheus.Counter
NodesDrained prometheus.Counter
NodesUncordoned prometheus.Counter
}
DrainerMetrics is struct of prometheus metrics to be exported
func InitDrainerMetrics ¶
func InitDrainerMetrics(prefix string) *DrainerMetrics
InitDrainerMetrics initializes these metrics
type Handler ¶
Handler implements a HTTP response handler that reports on the current liveness status of the controller
type Supervisor ¶
type Supervisor struct {
Prefix string
DrainerMetrics *DrainerMetrics
ClusterMetrics *ClusterMetrics
}
Supervisor is an object to manage the exported prometheus metrics
func InitSupervisor ¶
func InitSupervisor(prefix string) *Supervisor
InitSupervisor initializes the supervisor using the two contexts, drainer metrics and cluster metrics
func (*Supervisor) StartSupervising ¶
func (s *Supervisor) StartSupervising()
StartSupervising opens a web port that can be used by prometheus to track the metrics we are exposing