exporter

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TermOnDemand string = "JRTCKXETXF"
	TermPerHour  string = "6YS6EN2CT7"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	Unit         string
	EndRange     string
	Description  string
	AppliesTo    []string
	RateCode     string
	BeginRange   string
	PricePerUnit map[string]string
}

type Ec2Cost added in v0.8.0

type Ec2Cost struct {
	Type   string
	Total  float64
	VCpu   float64
	Memory float64
}

type Instance

type Instance struct {
	//Kind string
	Type         string
	VCpu         int32
	Memory       int64
	OnDemandCost *Ec2Cost
	SpotCost     map[string]*Ec2Cost
}

type Metrics

type Metrics struct {
	Instances map[string]*Instance
	Pods      map[string]*Pod
	Nodes     map[string]*Node
	Metrics   map[string]*prometheus.CounterVec
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(ctx context.Context, registry *prometheus.Registry, addPodLabels []string, addNodeLabels []string) (*Metrics, error)

func (*Metrics) Collect added in v0.5.0

func (m *Metrics) Collect(ch chan<- prometheus.Metric)

func (*Metrics) Describe added in v0.5.0

func (m *Metrics) Describe(ch chan<- *prometheus.Desc)

func (*Metrics) GetFargatePricing

func (m *Metrics) GetFargatePricing(ctx context.Context)

func (*Metrics) GetInstances

func (m *Metrics) GetInstances(ctx context.Context)

func (*Metrics) GetNodes

func (m *Metrics) GetNodes(ctx context.Context)

func (*Metrics) GetOnDemandPricing

func (m *Metrics) GetOnDemandPricing(ctx context.Context)

func (*Metrics) GetPods

func (m *Metrics) GetPods(ctx context.Context)

func (*Metrics) GetSpotPricing added in v0.8.0

func (m *Metrics) GetSpotPricing(ctx context.Context)

func (*Metrics) GetUsageCost added in v0.4.0

func (m *Metrics) GetUsageCost()

type Node

type Node struct {
	Name     string
	Labels   map[string]string
	AZ       string
	Region   string
	Instance *Instance
	Cost     *Ec2Cost
}

type Pod

type Pod struct {
	Name               string
	Namespace          string
	Labels             map[string]string
	Resources          *PodResources
	Node               *Node
	Usage              *PodResources
	Cost               float64
	VCpuCost           float64
	MemoryCost         float64
	VCpuRequestsCost   float64
	MemoryRequestsCost float64
}

type PodResources

type PodResources struct {
	Cpu    *resource.Quantity
	Memory *resource.Quantity
}

type Pricing

type Pricing struct {
	Product     Product
	ServiceCode string
	Terms       Terms
}

type Product

type Product struct {
	ProductFamily string
	Attributes    map[string]string
	Sku           string
}

type SKU

type SKU struct {
	PriceDimensions map[string]Details
	Sku             string
	EffectiveDate   string
	OfferTermCode   string
	TermAttributes  string
}

type Terms

type Terms struct {
	OnDemand map[string]SKU
	Reserved map[string]SKU
}

Jump to

Keyboard shortcuts

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