add percentage of benchmark progress

plan to release v0.48
This commit is contained in:
Chris Lu 2014-03-10 13:34:06 -07:00
parent 45757b8b55
commit c81f85e16d
2 changed files with 5 additions and 2 deletions

View file

@ -10,6 +10,7 @@ import (
"math" "math"
"math/rand" "math/rand"
"os" "os"
"runtime"
"strings" "strings"
"sync" "sync"
"time" "time"
@ -83,6 +84,8 @@ func runbenchmark(cmd *Command, args []string) bool {
fileIdLineChan := make(chan string) fileIdLineChan := make(chan string)
b.vid2server = make(map[string]string) b.vid2server = make(map[string]string)
fmt.Printf("This is Weed File System version %s %s %s\n", VERSION, runtime.GOOS, runtime.GOARCH)
if *b.write { if *b.write {
writeStats = newStats() writeStats = newStats()
idChan := make(chan int) idChan := make(chan int)
@ -278,7 +281,7 @@ func (s *stats) checkProgress(testName string, finishChan chan bool) {
case <-finishChan: case <-finishChan:
break break
case <-ticker: case <-ticker:
fmt.Printf("Completed %d of %d requests, %3d%%\n", s.completed, *b.numberOfFiles, s.completed*100 / *b.numberOfFiles) fmt.Printf("Completed %d of %d requests, %3.1f%%\n", s.completed, *b.numberOfFiles, float64(s.completed)*100/float64(*b.numberOfFiles))
} }
} }
} }

View file

@ -6,7 +6,7 @@ import (
) )
const ( const (
VERSION = "0.47" VERSION = "0.48"
) )
var cmdVersion = &Command{ var cmdVersion = &Command{