|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC 27/59] report: Allow report verbosity to be specified
From: George Dunlap <george.dunlap@xxxxxxxxxx>
Take a third argument to control the level of verbosity.
Also add helpful deltas when reporting the raw results.
Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
benchmark.go | 17 +++++++++++++++--
main.go | 11 ++++++++---
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/benchmark.go b/benchmark.go
index ffecb82..5e35997 100644
--- a/benchmark.go
+++ b/benchmark.go
@@ -342,10 +342,23 @@ func (run *BenchmarkRun) TextReport(level int) (err
error) {
s.AvgUtil, s.MinMaxUtil.Min,
s.MinMaxUtil.Max)
if level >= 2 {
+ var le WorkerReport
for _, e := range s.Raw {
+ var dtime float64
+ var dCputime time.Duration
+ var dKops int
time := float64(e.Now) / SEC
- fmt.Printf (" [%8.3f] %8.3f
%8d %12d\n", time,
- e.Cputime.Seconds(),
e.Kops, e.MaxDelta)
+ if e.Now > le.Now {
+ dtime = float64(e.Now -
le.Now) / SEC
+ dCputime = e.Cputime -
le.Cputime
+ dKops = e.Kops - le.Kops
+
+ }
+ fmt.Printf (" [%8.3f] (%8.3f)
%8.3f (%8.3f) %8d (%8d) %12d\n",
+ time, dtime,
+ e.Cputime.Seconds(),
dCputime.Seconds(),
+ e.Kops, dKops,
e.MaxDelta)
+ le = e
}
}
diff --git a/main.go b/main.go
index 6eaa39e..13230a7 100644
--- a/main.go
+++ b/main.go
@@ -22,6 +22,7 @@ package main
import (
"fmt"
"os"
+ "strconv"
)
func main() {
@@ -29,9 +30,9 @@ func main() {
switch(os.Args[1]) {
case "plan":
- workerA := []string{"burnwait", "7", "20000"}
+ workerA := []string{"burnwait", "70", "200000"}
//workerB := []string{"burnwait", "10", "20000000"}
- workerB := []string{"burnwait", "100", "3000000",
+ workerB := []string{"burnwait", "10", "300000",
"burnwait", "20", "300000",
"burnwait", "10", "300000",
"burnwait", "10", "300000",
@@ -91,13 +92,17 @@ func main() {
}
case "report":
+ verbosity := 0
+ if len(os.Args) > 2 {
+ verbosity, _ = strconv.Atoi(os.Args[2])
+ }
plan, err := LoadBenchmark(filename)
if err != nil {
fmt.Println("Loading benchmark ", filename, " ", err)
os.Exit(1)
}
- err = plan.TextReport(0)
+ err = plan.TextReport(verbosity)
if err != nil {
fmt.Println("Running benchmark run:", err)
os.Exit(1)
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |