Skip to content

Commit

Permalink
remove --serve as global flag and add it as analyzeFlags (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored May 21, 2021
1 parent 49d6829 commit 0d9473a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
go-version: [1.15.x, 1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
Expand Down
15 changes: 4 additions & 11 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,12 @@ func (s *Server) handleDownloadJSON(w http.ResponseWriter, req *http.Request) {

// handleStop handles requests to `/v1/stop`, stops the service.
func (s *Server) handleStop(w http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodDelete {
w.WriteHeader(200)
w.Write([]byte(`bye...`))
s.server.Close()
return
}
if req.Method == http.MethodGet {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(200)
w.Write([]byte(`{"status": "ok"}`))
if req.Method != http.MethodDelete {
w.WriteHeader(http.StatusBadRequest)
return
}
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(`bye...`))
s.server.Close()
}

// NewBenchmarkMonitor creates a new Server.
Expand Down
4 changes: 4 additions & 0 deletions cli/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ var analyzeFlags = []cli.Flag{
Name: "analyze.v",
Usage: "Display additional analysis data.",
},
cli.StringFlag{
Name: serverFlagName,
Usage: "When running benchmarks open a webserver to fetch results remotely, eg: localhost:7762",
},
}

var analyzeCmd = cli.Command{
Expand Down
4 changes: 0 additions & 4 deletions cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ var globalFlags = []cli.Flag{
Name: "autocompletion",
Usage: "install auto-completion for your shell",
},
cli.StringFlag{
Name: serverFlagName,
Usage: "When running benchmarks open a webserver to fetch results remotely, eg: localhost:7762",
},
}

var profileFlags = []cli.Flag{
Expand Down

0 comments on commit 0d9473a

Please sign in to comment.