billing

package
v0.29.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartBillingMetricsCollector added in v0.29.0

func StartBillingMetricsCollector(
	ctx context.Context,
	parentLogger *zap.Logger,
	conf *Config,
	store VMStoreForNode,
	metrics PromMetrics,
) error

Types

type BaseClientConfig added in v0.28.0

type BaseClientConfig struct {
	PushEverySeconds          uint `json:"pushEverySeconds"`
	PushRequestTimeoutSeconds uint `json:"pushRequestTimeoutSeconds"`
	MaxBatchSize              uint `json:"maxBatchSize"`
}

type ClientsConfig added in v0.28.0

type ClientsConfig struct {
	HTTP *HTTPClientConfig `json:"http"`
	S3   *S3ClientConfig   `json:"s3"`
}

type Config

type Config struct {
	Clients                ClientsConfig `json:"clients"`
	CPUMetricName          string        `json:"cpuMetricName"`
	ActiveTimeMetricName   string        `json:"activeTimeMetricName"`
	CollectEverySeconds    uint          `json:"collectEverySeconds"`
	AccumulateEverySeconds uint          `json:"accumulateEverySeconds"`
}

type HTTPClientConfig added in v0.28.0

type HTTPClientConfig struct {
	BaseClientConfig
	URL string `json:"url"`
}

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 S3ClientConfig added in v0.29.0

type S3ClientConfig struct {
	BaseClientConfig
	billing.S3ClientConfig
}

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