Commit 30111d3e authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Drop bulkstat binary.

parent 011e4ecc
package main
// Given a file with filenames, this times how fast we can stat them
// in parallel. This is useful for benchmarking purposes.
import (
"bufio"
"flag"
"github.com/hanwen/go-fuse/benchmark"
"log"
"os"
"runtime"
"time"
)
func main() {
threads := flag.Int("threads", 0, "number of parallel threads in a run. If 0, use CPU count.")
sleepTime := flag.Float64("sleep", 4.0, "amount of sleep between runs.")
runs := flag.Int("runs", 10, "number of runs.")
flag.Parse()
if *threads == 0 {
*threads = fuse.CountCpus()
runtime.GOMAXPROCS(*threads)
}
filename := flag.Args()[0]
f, err := os.Open(filename)
if err != nil {
log.Panicf("Open: %v", err)
}
reader := bufio.NewReader(f)
files := make([]string, 0)
for {
l, _, err := reader.ReadLine()
if err != nil {
break
}
files = append(files, string(l))
}
d := time.Duration(*sleepTime * float64(time.Second))
results := fuse.RunBulkStat(*runs, *threads, d, files)
fuse.AnalyzeBenchmarkRuns(results)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment