collector

package
v0.3.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	Name                       string                          `json:"name"`
	Properties                 *kubecost.AllocationProperties  `json:"properties,omitempty"`
	Window                     Window                          `json:"window"`
	Start                      time.Time                       `json:"start"`
	End                        time.Time                       `json:"end"`
	CPUCoreHours               float64                         `json:"cpuCoreHours"`
	CPUCoreRequestAverage      float64                         `json:"cpuCoreRequestAverage"`
	CPUCoreUsageAverage        float64                         `json:"cpuCoreUsageAverage"`
	CPUCost                    float64                         `json:"cpuCost"`
	CPUCostAdjustment          float64                         `json:"cpuCostAdjustment"`
	GPUHours                   float64                         `json:"gpuHours"`
	GPUCost                    float64                         `json:"gpuCost"`
	GPUCostAdjustment          float64                         `json:"gpuCostAdjustment"`
	NetworkTransferBytes       float64                         `json:"networkTransferBytes"`
	NetworkReceiveBytes        float64                         `json:"networkReceiveBytes"`
	NetworkCost                float64                         `json:"networkCost"`
	NetworkCrossZoneCost       float64                         `json:"networkCrossZoneCost"`
	NetworkCrossRegionCost     float64                         `json:"networkCrossRegionCost"`
	NetworkInternetCost        float64                         `json:"networkInternetCost"`
	NetworkCostAdjustment      float64                         `json:"networkCostAdjustment"`
	LoadBalancerCost           float64                         `json:"loadBalancerCost"`
	LoadBalancerCostAdjustment float64                         `json:"loadBalancerCostAdjustment"`
	PVs                        kubecost.PVAllocations          `json:"pvs"`
	PVCostAdjustment           float64                         `json:"pvCostAdjustment"`
	RAMByteHours               float64                         `json:"ramByteHours"`
	RAMBytesRequestAverage     float64                         `json:"ramByteRequestAverage"`
	RAMBytesUsageAverage       float64                         `json:"ramByteUsageAverage"`
	RAMCost                    float64                         `json:"ramCost"`
	RAMCostAdjustment          float64                         `json:"ramCostAdjustment"`
	SharedCost                 float64                         `json:"sharedCost"`
	ExternalCost               float64                         `json:"externalCost"`
	RawAllocationOnly          *kubecost.RawAllocationOnlyData `json:"rawAllocationOnly"`
}

type AllocationComputeResponse

type AllocationComputeResponse struct {
	Code    int                     `json:"code"`
	Status  string                  `json:"status"`
	Data    []map[string]Allocation `json:"data"`
	Message string                  `json:"message,omitempty"`
	Warning string                  `json:"warning,omitempty"`
}

type ClusterCostResponse

type ClusterCostResponse struct {
	Code    int                                `json:"code"`
	Status  string                             `json:"status"`
	Data    map[string]*costmodel.ClusterCosts `json:"data"`
	Message string                             `json:"message,omitempty"`
	Warning string                             `json:"warning,omitempty"`
}

type Collector

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

func NewCollector

func NewCollector(
	restCfg *rest.Config,
	conn *model.Connector,
	clusterName string,
) (*Collector, error)

func (*Collector) K8sCosts

func (c *Collector) K8sCosts(
	startTime, endTime *time.Time,
	step time.Duration,
) ([]*model.CostReport, error)

type PrometheusQueryRangeResult

type PrometheusQueryRangeResult struct {
	Status string                         `json:"status"`
	Data   PrometheusQueryRangeResultData `json:"data"`
}

type PrometheusQueryRangeResultData

type PrometheusQueryRangeResultData struct {
	ResultType string        `json:"resultType"`
	Result     []QueryResult `json:"result"`
}

type QueryResult

type QueryResult struct {
	Metric map[string]any `json:"metric"`
	Values [][]any        `json:"values"`
}

type Vector

type Vector struct {
	Timestamp float64 `json:"timestamp"`
	Value     any     `json:"value"`
}

type Window

type Window struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

Jump to

Keyboard shortcuts

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