Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
  • Loading branch information
shtripat committed Jul 20, 2023
1 parent 94f3565 commit 6027177
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cmd/admin-prometheus-metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,13 @@ func printPrometheusMetrics(ctx *cli.Context) error {
if e != nil {
return e
}
var metricsSubSystem string
switch args.Get(1) {
case "node":
metricsSubSystem = "node"
case "bucket":
metricsSubSystem = "bucket"
metricsSubSystem := args.Get(1)
switch metricsSubSystem {
case "node", "bucket", "cluster":
case "":
metricsSubSystem = "cluster"
default:
fatalIf(errInvalidArgument().Trace(), "invalid metric type '%v'", args.Get(1))
fatalIf(errInvalidArgument().Trace(), "invalid metric type '%v'", metricsSubSystem)
}

req, e := http.NewRequest(http.MethodGet, hostConfig.URL+metricsEndPointRoot+metricsSubSystem, nil)
Expand Down

0 comments on commit 6027177

Please sign in to comment.