Skip to content

Commit dad1b56

Browse files
committed
[add] Priting version info on runs
1 parent d5b2f84 commit dad1b56

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

redis-zbench-go.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ func main() {
5151
pipeline := flag.Uint64("pipeline", 1, "Redis pipeline value.")
5252
version := flag.Bool("v", false, "Output version and exit")
5353
flag.Parse()
54+
git_sha := toolGitSHA1()
55+
git_dirty_str := ""
56+
if toolGitDirty() {
57+
git_dirty_str = "-dirty"
58+
}
5459
if *version {
55-
git_sha := toolGitSHA1()
56-
git_dirty_str := ""
57-
if toolGitDirty() {
58-
git_dirty_str = "-dirty"
59-
}
6060
fmt.Fprintf(os.Stdout, "redis-zbench-go (git_sha1:%s%s)\n", git_sha, git_dirty_str)
6161
os.Exit(0)
6262
}
@@ -93,6 +93,7 @@ func main() {
9393
stopChan := make(chan struct{})
9494
// a WaitGroup for the goroutines to tell us they've stopped
9595
wg := sync.WaitGroup{}
96+
fmt.Printf("Using redis-zbench-go (git_sha1:%s%s)\n", git_sha, git_dirty_str)
9697
fmt.Printf("Total clients: %d. Commands per client: %d Total commands: %d\n", *clients, samplesPerClient, totalCmds)
9798
fmt.Printf("Using random seed: %d\n", *seed)
9899
rand.Seed(*seed)

0 commit comments

Comments
 (0)