Skip to content

Commit

Permalink
Making workers-scale to accept custom metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Vishnu Challa <[email protected]>
  • Loading branch information
Vishnu Challa committed Oct 20, 2024
1 parent 646f48f commit 52e02aa
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions workers-scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"encoding/json"
"fmt"
"os"
"strings"
"time"

"github.com/cloud-bulldozer/go-commons/indexers"
Expand All @@ -37,15 +36,14 @@ import (
// NewWorkersScale orchestrates scaling workers in ocp wrapper
func NewWorkersScale(metricsEndpoint *string, ocpMetaAgent *ocpmetadata.Metadata) *cobra.Command {
var enableAutoscaler, isHCP bool
var metricsProfile, mcKubeConfig string
var userMetadata, metricsDirectory string
var uuid, mcKubeConfig string
var metricsProfiles []string
var userMetadata, metricsDirectory, tarballName string
var prometheusStep time.Duration
var uuid string
var err error
var scaleEventEpoch int64
var rc, additionalWorkerNodes int
var prometheusURL, prometheusToken string
var tarballName string
var indexer config.MetricsEndpoint
var clusterMetadataMap map[string]interface{}
const autoScaled = "autoScaled"
Expand All @@ -71,9 +69,6 @@ func NewWorkersScale(metricsEndpoint *string, ocpMetaAgent *ocpmetadata.Metadata
log.Fatal("Error obtaining prometheus information from cluster: ", err.Error())
}
}
metricsProfiles := strings.FieldsFunc(metricsProfile, func(r rune) bool {
return r == ',' || r == ' '
})
indexer = config.MetricsEndpoint{
Endpoint: prometheusURL,
Token: prometheusToken,
Expand Down Expand Up @@ -179,7 +174,7 @@ func NewWorkersScale(metricsEndpoint *string, ocpMetaAgent *ocpmetadata.Metadata
burner.IndexJobSummary([]burner.JobSummary{jobSummary}, indexerValue)
},
}
cmd.Flags().StringVarP(&metricsProfile, "metrics-profile", "m", "metrics.yml", "Comma-separated list of metric profiles")
cmd.Flags().StringSliceVar(&metricsProfiles, "metrics-profile", []string{"metrics-nodebootup.yml", "metrics-nodebootup-report.yml"}, "Comma separated list of metrics profiles to use")
cmd.Flags().StringVar(&metricsDirectory, "metrics-directory", "collected-metrics", "Directory to dump the metrics files in, when using default local indexing")
cmd.Flags().StringVar(&mcKubeConfig, "mc-kubeconfig", "", "Path for management cluster kubeconfig")
cmd.Flags().DurationVar(&prometheusStep, "step", 30*time.Second, "Prometheus step size")
Expand Down

0 comments on commit 52e02aa

Please sign in to comment.