monitoring

package
v0.0.0-...-00dc8c7 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

Carbon Monitoring

Caspian periodically calls Carbon monitoring to update the carbon spec of ClusterInfo custum resources. The figure below shows the steps that carbon monitoring takes to update this field. Carbon monitoring retrieves the carbon intensity data from Electricity Maps.

Picture1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterInfoResource = schema.GroupVersionResource{Group: mcadv1beta1.GroupVersion.Group,
	Version: mcadv1beta1.GroupVersion.Version, Resource: "clusterinfo"}

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	Spokes []core.Cluster

	T int
	// contains filtered or unexported fields
}

A monitor instace contains a list of Clusters, and rest client

func NewMonitor

func NewMonitor(config *rest.Config) *Monitor

NewMonior creates a Monitor instance and configures its clients.

func (Monitor) GetCarbonFromFile

func (m Monitor) GetCarbonFromFile(FilePath string) ([]string, bool)

Read carbon from file

func (*Monitor) GetClusters

func (m *Monitor) GetClusters() error

create the list of spoke Clusters, each spoke is corresponding to one clusterinfo object in hub

func (Monitor) GetForecastedCarbonIntensity

func (m Monitor) GetForecastedCarbonIntensity(zone string) ([]string, bool)

func (Monitor) UpdateCarbon

func (m Monitor) UpdateCarbon(spoke core.Cluster) error

Retrive carbon intensity and update the carbon field of clusterinfo object

func (Monitor) UpdateClusterInfo

func (m Monitor) UpdateClusterInfo() error

get the names and geolocation of each spoke, update the carbon intensity of its corresponding cluster Info object in the hub.

Jump to

Keyboard shortcuts

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