Documentation ¶
Index ¶
- Constants
- func CollectCronJobs(cronjobs []batchv1.CronJob) (*MetricSet, StateSet)
- func CollectDaemonSets(daemonsets []appsv1.DaemonSet) (*MetricSet, StateSet)
- func CollectDeployments(deployments []appsv1.Deployment) (*MetricSet, StateSet)
- func CollectJobs(jobs []batchv1.Job) (*MetricSet, StateSet)
- func CollectPods(pods []corev1.Pod) (*MetricSet, StateSet)
- func CollectReplicaSets(replicasets []appsv1.ReplicaSet) (*MetricSet, StateSet)
- func CollectStatefulSets(statefulsets []appsv1.StatefulSet) (*MetricSet, StateSet)
- func ConvertToMetricData(timestamp time.Time, cluster string, states StateSet) []awstypes.MetricDatum
- func Log(writer io.Writer, metrics *MetricSet) error
- type Metric
- type MetricSet
- type Pusher
- type StateSet
Constants ¶
const ( // KindPod is the cost reference to the Kubernetes Pod object. KindPod = "Pod" // KindDaemonSet is a daemonset. KindDaemonSet = "DaemonSet" // KindDeployment is the cost reference to the Kubernetes Deployment object. KindDeployment = "Deployment" // KindReplicaSet is the cost reference to the Kubernetes ReplicaSet object. KindReplicaSet = "ReplicaSet" // KindStatefulSet is the cost reference to the Kubernetes StatefulSet object. KindStatefulSet = "StatefulSet" // KindCronJob is the cost reference to the Kubernetes CronJob object. KindCronJob = "CronJob" // KindJob is the cost reference to the Kubernetes Job object. KindJob = "Job" // StateScaledDown indicates the desired replicas for the object is 0. StateScaledDown = "ScaledDown" // StateReady is the const representing the state for an object being Ready StateReady = string(corev1.PodReady) // StateNotReady is the const representing the state for an object not being Ready StateNotReady = string(corev1.PodPending) // StateSuspended is the const representing the state for a CronJob being Suspended StateSuspended = string(batchv1.JobSuspended) // StateActive is the const representing the state for a CronJob being not Suspended StateActive = "Active" // StateRunning is the const representing the state for a Job currently running StateRunning = string(corev1.PodRunning) // StateFailed is the const representing the state for an object having been Failed StateFailed = string(batchv1.JobFailed) // StateSucceeded is the const representing the state for an object having been completed successfully StateSucceeded = string(batchv1.JobComplete) // StateAvailable is the state of which a DaemonSet is available for scheduling. StateAvailable = "Available" StateUnavailable = "Unavailable" // StateMisscheduled is the state of which a DaemonSet was not able to schedule. StateMisscheduled = "Misscheduled" // StateScheduled is the state of which a DaemonSet was able to schedule. StateScheduled = "Scheduled" )
Variables ¶
This section is empty.
Functions ¶
func CollectCronJobs ¶ added in v0.0.11
CollectCronJobs will collect ze metrics for cronjobs.
func CollectDaemonSets ¶ added in v0.0.12
CollectDaemonSets will collect ze metrics for statefulsets.
func CollectDeployments ¶ added in v0.0.11
func CollectDeployments(deployments []appsv1.Deployment) (*MetricSet, StateSet)
CollectDeployments will collect ze metrics for deployments.
func CollectJobs ¶ added in v0.0.11
CollectJobs will collect ze metrics for jobs.
func CollectPods ¶ added in v0.0.11
CollectPods will collect ze metrics for pods.
func CollectReplicaSets ¶ added in v0.0.11
func CollectReplicaSets(replicasets []appsv1.ReplicaSet) (*MetricSet, StateSet)
CollectReplicaSets will collect ze metrics for replicasets.
func CollectStatefulSets ¶ added in v0.0.11
func CollectStatefulSets(statefulsets []appsv1.StatefulSet) (*MetricSet, StateSet)
CollectStatefulSets will collect ze metrics for statefulsets.
func ConvertToMetricData ¶ added in v0.0.10
func ConvertToMetricData(timestamp time.Time, cluster string, states StateSet) []awstypes.MetricDatum
ConvertToMetricData converts our metrics to aws metric data.
Types ¶
type Metric ¶
type Metric struct { Name string `json:"name"` Value int `json:"value"` Type string `json:"type"` Labels map[string]string `json:"labels"` }
Metric represents an individual metric.
type MetricSet ¶
MetricSet is the metric set.
func CombineRecords ¶ added in v0.0.11
CombineRecords will combine two metric sets.
type Pusher ¶ added in v0.0.10
type Pusher struct {
// contains filtered or unexported fields
}
Pusher the metrics pusher.
func NewPusher ¶ added in v0.0.10
func NewPusher(cloudwatchClient types.CloudwatchInterface) *Pusher
NewPusher creates a new metrics pusher.
type StateSet ¶ added in v0.0.11
StateSet is the state of the metrics. ie Pod Phase, Deployment Status or CronJob Suspended state.
func CombineStates ¶ added in v0.0.11
CombineStates will combine two state sets.