Skip to content

Commit

Permalink
Merge pull request #12 from redis-performance/pprof.producer
Browse files Browse the repository at this point in the history
Enabling pprof on producer flow
  • Loading branch information
filipecosta90 authored Sep 25, 2023
2 parents 223c294 + 32140a7 commit b9b904c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"log"
"math"
"math/rand"
"net/http"
"os"
"os/signal"
"sync"
Expand Down Expand Up @@ -72,6 +73,7 @@ var producerCmd = &cobra.Command{
loop, _ := cmd.Flags().GetBool("loop")
readBufferEachConn, _ := cmd.Flags().GetInt("read-buffer-each-conn")
writeBufferEachConn, _ := cmd.Flags().GetInt("write-buffer-each-conn")
pprofPort, _ := cmd.Flags().GetInt64("pprof-port")

if nClients > uint64(keyspaceLen) {
log.Fatalf("The number of clients needs to be smaller or equal to the number of streams")
Expand All @@ -83,6 +85,10 @@ var producerCmd = &cobra.Command{
// a WaitGroup for the goroutines to tell us they've stopped
wg := sync.WaitGroup{}

go func() {
http.ListenAndServe(fmt.Sprintf(":%d", pprofPort), nil)
}()

fmt.Printf("Using random seed: %d. Each client will have seed of %d+<client id>\n", seed, seed)

var requestRate = Inf
Expand Down

0 comments on commit b9b904c

Please sign in to comment.