Skip to content

Commit

Permalink
Add debug info. Revert this commit as soon as possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
cscatolini committed Dec 19, 2018
1 parent ff669a7 commit 6adf0fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metadata/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package metadata

//Version of Maestro
var Version = "7.4.4"
var Version = "7.4.5"

//KubeVersion is the desired Kubernetes version
var KubeVersion = "v1.10.0"
8 changes: 7 additions & 1 deletion models/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ func (r *Room) SetStatus(
pipe.ZRem(lastStatusChangedKey, r.ID)
}

r.addUtilizationMetricsToRedis(metricsClientset, pipe, scheduler, mr)
mr.WithSegment("debug", func() error {
r.addUtilizationMetricsToRedis(metricsClientset, pipe, scheduler, mr)
return nil
})
// remove from other statuses to be safe
for _, st := range allStatus {
if st != status {
Expand All @@ -156,6 +159,7 @@ func (r *Room) addUtilizationMetricsToRedis(
scheduler *Scheduler,
mr *MixedMetricsReporter,
) {
fmt.Println("[DEBUG] entered addUtilizationMetricsToRedis")
sp := scheduler.GetAutoScalingPolicy()
metricsMap := map[AutoScalingPolicyType]bool{}
metricsTriggers := append(sp.Up.MetricsTrigger, sp.Down.MetricsTrigger...)
Expand All @@ -166,9 +170,11 @@ func (r *Room) addUtilizationMetricsToRedis(
}

if len(metricsMap) == 0 {
fmt.Println("[DEBUG] no metrics enabled, exit")
return
}

fmt.Println("[DEBUG] retrieving metrics")
requests := scheduler.GetResourcesRequests()
var pmetrics *v1beta1.PodMetrics
err := mr.WithSegment(SegmentMetrics, func() error {
Expand Down

0 comments on commit 6adf0fc

Please sign in to comment.