package
0.0.0-20200512205314-bea9c9c33c9f
Repository: https://github.com/planetlabs/kostanza.git
Documentation: pkg.go.dev

# Functions

NewBufferingCostExporter returns a BufferingCostExporter that flushes on the provided interval.
NewConfigFromReader constructs a Config from an io.Reader.
NewKubernetesCoster returns a new coster that talks to a kubernetes cluster via the provided client.
NewPubsubCostExporter creates a new PubsubCostExporter, instantiating an internal client against google cloud APIs.
NewStatsCostExporter returns a new StatsCostExporter.
RunningPodFilter returns true if the Pod is running.

# Constants

ResourceGPU is used for gpu resources, coinciding with modern versions of the nvidia-device-plugin.
StrategyNameCPU is used whenever we derive a cost metric using the CPUPricingStrategy.
StrategyNameGPU is used whenever we derive a cost metric using the GPUPricingStrategy.
StrategyNameMemory is used whenever we derive a cost metric using the MemoryPricingStrategy.
StrategyNameNode is used whenever we derive a cost metric using the NodePricingStrategy.
StrategyNameWeighted is used whenever we derive a cost metric using the WeightedPricingStrategy.

# Variables

CPUPricingStrategy calculates the cost of a pod based strictly on it's share of CPU requests as a fraction of all CPU available on the node onto which it is allocated.
ErrNoCostEntry is returned when we cannot find a suitable CostEntry in a CostTable.
ErrNoPodNode may be returned during races where the pod containing a given node has disappeared.
ErrSenselessInterval is returned if the difference since our last run time is less than 0.
GPUPricingStrategy generates cost metrics that account for the cost of GPUs consumed by pods.
MeasureCost is the stat for tracking costs in millionths of a cent.
MeasureCycles is the number of tracking loops conducted.
MeasureLag is the discrepancy between the ideal interval and actual interval between calculations.
MeasurePubsubPublishErrors tracks publishing errors in the PubsubCostExporter.
MemoryPricingStrategy calculates the cost of a pod based strictly on it's share of memory requests as a fraction of all memory on the node onto which it was scheduled.
NodePricingStrategy generates cost metrics that represent the cost of an active node, regardless of pod.
ResourceCostCPU is a cost metric derived from CPU utilization.
ResourceCostGPU is a cost metric derived from GPU utilization.
ResourceCostMemory is a cost metric derived from memory utilization.
ResourceCostNode represents the overall cost of a node.
ResourceCostWeighted is a cost metric derived from a weighted average of memory and cpu utilization.
TagStatus indicates the success or failure of an operation.
WeightedPricingStrategy calculates the cost of a pod based on it's average use of the CPU and Memory requests as a fraction of all CPU and memory requests on the node onto which it has been allocated.

# Structs

BufferingCostExporter is an exporter that locally merges similarly dimensioned data on the client before emitting to other exporters.
Config contains the configuration data necessary to drive the kubernetesCoster.
CostData models pubsub-exported cost metadata.
CostDataKey groups related cost data.
CostItem models the metadata associated with a pod and/or node cost.
CostTable is a collection of CostTableEntries, generally used to look up pricing data via a set of labels provided callers of it's FindByLabels method.
CostTableEntry models the cost of a nodes resources.
Mapper is a used to manage a set of mappings from source fields in a generic interface{} to a destination.
Mapping models how to map a destination field from a source field within a kubernetes resource.
PubsubCostExporter emits data to pubsub.
StatsCostExporter emits metrics to a stats system.

# Interfaces

Coster is used to calculate and emit metrics for services and components running in a kubernetes cluster.
CostExporter emits CostItems - for example, as a metric or to a third-party system.
PricingStrategy generates CostItems given the pods and nodes running in a cluster.

# Type aliases

Labels augments a slice ofa labels with matching functionality.
PodFilter returns true if Pod should be included in filtered results.
PodFilters augments a slice of PodFilter functions with additional collection related functionality.
PricingStrategyFunc is an interface wrapper to convert a function into valid PricingStrategy.
ResourceCostKind is used to indidicate what resource a cost was derived from.