-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate cpu and mem savings in tortoise #427
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,35 +46,35 @@ var ( | |
Help: "memory request (byte) that tortoises actually applys", | ||
}, []string{"tortoise_name", "namespace", "container_name", "controller_name", "controller_kind"}) | ||
|
||
DecreaseApplyCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ | ||
Name: "decrease_apply_counter", | ||
Help: "counter for number of resource decreases applied by tortoise", | ||
}, []string{"tortoise_name", "namespace"}) | ||
|
||
IncreaseApplyCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ | ||
Name: "increase_apply_counter", | ||
Help: "counter for number of resource increases applied by tortoise", | ||
}, []string{"tortoise_name", "namespace"}) | ||
|
||
NetHPAMinReplicas = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_hpa_minreplicas", | ||
Help: "net hpa minReplicas that tortoises actually applys to hpa", | ||
}, []string{"tortoise_name", "namespace", "hpa_name", "kube_deployment"}) | ||
|
||
NetHPAMaxReplicas = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_hpa_maxreplicas", | ||
Help: "net hpa maxReplicas that tortoises actually applys to hpa", | ||
}, []string{"tortoise_name", "namespace", "hpa_name", "kube_deployment"}) | ||
NetHPAMinReplicasCPUCores = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_hpa_minreplicas_cpu_cores", | ||
Help: "net cpu cores changed by minReplicas that tortoises actually applys to hpa", | ||
}, []string{"tortoise_name", "namespace", "hpa_name"}) | ||
|
||
NetHPAMinReplicasMemory = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_hpa_minreplicas_memory", | ||
Help: "net memory changed by minReplicas that tortoises actually applys to hpa", | ||
}, []string{"tortoise_name", "namespace", "hpa_name"}) | ||
|
||
NetHPAMaxReplicasCPUCores = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_hpa_maxreplicas_cpu_cores", | ||
Help: "net cpu cores changed by maxReplicas that tortoises actually applys to hpa", | ||
}, []string{"tortoise_name", "namespace", "hpa_name"}) | ||
|
||
NetHPAMaxReplicasMemory = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_hpa_maxreplicas_memory", | ||
Help: "net memory changed by maxReplicas that tortoises actually applys to hpa", | ||
}, []string{"tortoise_name", "namespace", "hpa_name"}) | ||
|
||
NetCPURequest = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_cpu_request", | ||
Help: "net cpu request (millicore) that tortoises actually applys", | ||
}, []string{"tortoise_name", "namespace", "container_name", "controller_name", "controller_kind"}) | ||
}, []string{"tortoise_name", "namespace", "container_name", "kube_deployment", "controller_kind"}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we have to change it? I do prefer controller_name, which allows us to support other kind of resources (replicaset etc) in the future, and is also consistent with GKE metrics. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm but which controller is it referring to? because in the code it is actually referring to the deployment name. i just thought controller_name was a little confusing. But as you mentioned about the breaking change then we could leave it as is because theres no specific need to change it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I remember initially I wanted to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, make a complaint to GKE 😅 |
||
|
||
NetMemoryRequest = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "net_memory_request", | ||
Help: "net memory request (byte) that tortoises actually applys", | ||
}, []string{"tortoise_name", "namespace", "container_name", "controller_name", "controller_kind"}) | ||
}, []string{"tortoise_name", "namespace", "container_name", "kube_deployment", "controller_kind"}) | ||
|
||
ProposedHPATargetUtilization = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "proposed_hpa_utilization_target", | ||
|
@@ -117,10 +117,10 @@ func init() { | |
AppliedHPAMinReplicas, | ||
AppliedCPURequest, | ||
AppliedMemoryRequest, | ||
IncreaseApplyCounter, | ||
DecreaseApplyCounter, | ||
NetHPAMaxReplicas, | ||
NetHPAMinReplicas, | ||
NetHPAMinReplicasCPUCores, | ||
NetHPAMinReplicasMemory, | ||
NetHPAMaxReplicasCPUCores, | ||
NetHPAMaxReplicasMemory, | ||
NetCPURequest, | ||
NetMemoryRequest, | ||
ProposedHPATargetUtilization, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "net" mean?