billing

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBillingMetricsCollector

func RunBillingMetricsCollector(
	backgroundCtx context.Context,
	parentLogger *zap.Logger,
	conf *Config,
	store VMStoreForNode,
	metrics PromMetrics,
)

Types

type Config

type Config struct {
	URL                       string `json:"url"`
	CPUMetricName             string `json:"cpuMetricName"`
	ActiveTimeMetricName      string `json:"activeTimeMetricName"`
	CollectEverySeconds       uint   `json:"collectEverySeconds"`
	AccumulateEverySeconds    uint   `json:"accumulateEverySeconds"`
	PushEverySeconds          uint   `json:"pushEverySeconds"`
	PushRequestTimeoutSeconds uint   `json:"pushRequestTimeoutSeconds"`
	MaxBatchSize              uint   `json:"maxBatchSize"`
}

type PromMetrics

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

func NewPromMetrics

func NewPromMetrics() PromMetrics

func (PromMetrics) MustRegister

func (m PromMetrics) MustRegister(reg *prometheus.Registry)

type VMNodeIndex

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

VMNodeIndex is a watch.Index that stores all of the VMs for a particular node

We have to implement this ourselves because K8s does not (as of 2023-04-04) support field selectors on CRDs, so we can't have the API server filter out VMs for us.

For more info, see: https://github.com/kubernetes/kubernetes/issues/53459 This comment in particular was particularly instructive: https://github.com/kubernetes/kubernetes/issues/53459#issuecomment-1146200268

func NewVMNodeIndex

func NewVMNodeIndex(node string) *VMNodeIndex

func (*VMNodeIndex) Add

func (i *VMNodeIndex) Add(vm *vmapi.VirtualMachine)

func (*VMNodeIndex) Delete

func (i *VMNodeIndex) Delete(vm *vmapi.VirtualMachine)

func (*VMNodeIndex) List

func (i *VMNodeIndex) List() []*vmapi.VirtualMachine

func (*VMNodeIndex) Update

func (i *VMNodeIndex) Update(oldVM, newVM *vmapi.VirtualMachine)

Jump to

Keyboard shortcuts

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