Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Alec Holmes <[email protected]>
  • Loading branch information
alecholmez committed Jan 27, 2023
1 parent 632c311 commit 289ca0a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
These benchmarks are designed to run off the integration test suite, and provide detailed profiling artifacts generated with pprof.

## Prerequisites
- [Go 1.16+](https://golang.org/dl/)
- [Go 1.17+](https://golang.org/dl/)
- [Graphviz](https://graphviz.org/download/)
- [pprof](https://github.com/google/pprof)
- [Docker](https://www.docker.com/)
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/client/main.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"runtime"
"time"

"github.com/envoyproxy/go-control-plane/benchmarks/client/xds"
"github.com/urfave/cli/v2"

"github.com/envoyproxy/go-control-plane/benchmarks/client/xds"
)

func main() {
Expand Down
7 changes: 4 additions & 3 deletions benchmarks/client/xds/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

// Sess holds a grpc connection as well as config options to use during the simulation
Expand All @@ -19,7 +20,7 @@ func NewSession(url string, opts ...Option) (*Sess, error) {
o(&options)
}

conn, err := grpc.Dial(url, grpc.WithBlock(), grpc.WithInsecure())
conn, err := grpc.Dial(url, grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, err
}
Expand All @@ -30,16 +31,16 @@ func NewSession(url string, opts ...Option) (*Sess, error) {
}, nil
}

// Simulate will start an xDS stream which provides simulatest clients communicating with an xDS server
// Simulate will start an xDS stream which provides simulated clients communicating with an xDS server
func (s *Sess) Simulate(target time.Duration) error {
// Create a loop that will continually do work until the elapsed time as passed
for timeout := time.After(target); ; {
select {
case <-timeout:
return nil
default:
// TODO(alec): implement me
// Do some work

}
}
}
20 changes: 10 additions & 10 deletions pkg/test/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import (
)

const (
PPROF_CPU int = iota
PPROF_HEAP
PPROF_MUTEX
PPROF_BLOCK
PPROF_GOROUTINE
PprofCPU int = iota
PprofHEAP
PprofMUTEX
PprofBLOCK
PprofGOROUTINE
)

var (
Expand Down Expand Up @@ -171,15 +171,15 @@ func main() {

if debug {
switch pprofMode {
case PPROF_CPU:
case PprofCPU:
defer profile.Start(profile.CPUProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop()
case PPROF_HEAP:
case PprofHEAP:
defer profile.Start(profile.MemProfile, profile.ProfilePath(".")).Stop()
case PPROF_MUTEX:
case PprofMUTEX:
defer profile.Start(profile.MutexProfile, profile.ProfilePath(".")).Stop()
case PPROF_BLOCK:
case PprofBLOCK:
defer profile.Start(profile.BlockProfile, profile.ProfilePath(".")).Stop()
case PPROF_GOROUTINE:
case PprofGOROUTINE:
defer profile.Start(profile.GoroutineProfile, profile.ProfilePath(".")).Stop()
}
}
Expand Down

0 comments on commit 289ca0a

Please sign in to comment.