[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC 24/59] report: Lots of changes



From: George Dunlap <george.dunlap@xxxxxxxxxx>

Store raw worker reports in the worker summary for easy printing.

Add "level" argument to textreport to easly switch between different
levels of granularity.

Report total throughput, time, and cputime for workers.

When running, print plain time and aggregate cputime in addition to
deltas.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
 benchmark.go | 34 +++++++++++++++++++++++++++-------
 main.go      |  2 +-
 run.go       |  7 +++++--
 3 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/benchmark.go b/benchmark.go
index 7ea9aaa..73c5441 100644
--- a/benchmark.go
+++ b/benchmark.go
@@ -115,8 +115,12 @@ func (mm *MinMax) Update(x float64) {
 }
 
 type WorkerSummary struct {
+       Raw []WorkerReport
        MinMaxTput MinMax
        MinMaxUtil MinMax
+       TotalTput int
+       TotalTime time.Duration
+       TotalCputime time.Duration
        AvgTput float64
        AvgUtil float64
 }
@@ -201,7 +205,7 @@ func (run *BenchmarkRun) Process() (err error) {
                }
 
                ws := &run.Results.Summary[e.Id.Set]
-               
+
                if e.Id.Id > len(ws.Workers) {
                        return fmt.Errorf("Internal error: e.Id.Id %d > 
len(Results.Summary[].Workers) %d\n",
                                e.Id.Id, len(ws.Workers))
@@ -209,6 +213,8 @@ func (run *BenchmarkRun) Process() (err error) {
 
                s := &ws.Workers[e.Id.Id]
 
+               s.Raw = append(s.Raw, e)
+               
                d := data[e.Id]
                if d == nil {
                        d = &Data{}
@@ -236,6 +242,10 @@ func (run *BenchmarkRun) Process() (err error) {
                ws := &run.Results.Summary[Id.Set]
                s := &ws.Workers[Id.Id]
 
+               s.TotalTput = d.lastMops
+               s.TotalTime = time.Duration(d.lastTime - d.startTime)
+               s.TotalCputime = d.lastCputime - d.startCputime
+               
                s.AvgTput = Throughput(d.startTime, 0, d.lastTime, d.lastMops)
                s.AvgUtil = Utilization(d.startTime, d.startCputime, 
d.lastTime, d.lastCputime)
 
@@ -287,7 +297,7 @@ func (run *BenchmarkRun) Process() (err error) {
        return
 }
 
-func (run *BenchmarkRun) TextReport() (err error) {
+func (run *BenchmarkRun) TextReport(level int) (err error) {
        var done bool
        done, err = run.checkSummary()
        if err != nil {
@@ -320,15 +330,25 @@ func (run *BenchmarkRun) TextReport() (err error) {
                        ws.MinMaxAvgUtil.Min, ws.MinMaxUtil.Max, 
ws.MinMaxUtil.Min)
        }
 
-       if true {
-               fmt.Printf("\n%8s %8s %8s %8s %8s %8s %8s\n", "workerid", 
"tavg", "tmin", "tmax", "uavg", "umin", "umax")
+       if level >= 1 {
+               fmt.Printf("\n%8s %8s %8s %8s %8s %8s %8s %8s %8s %8s\n", 
"workerid", "toput", "time", "cpu", "tavg", "tmin", "tmax", "uavg", "umin", 
"umax")
                for set := range run.Results.Summary {
                        for id := range run.Results.Summary[set].Workers {
                                s := run.Results.Summary[set].Workers[id]
-                               fmt.Printf("%2d:%2d    %8.2f %8.2f %8.2f %8.2f 
%8.2f %8.2f\n",
+                               fmt.Printf("%2d:%2d    %10d %8.2f %8.2f %8.2f 
%8.2f %8.2f %8.2f %8.2f %8.2f\n",
                                        set, id,
+                                       s.TotalTput, s.TotalTime.Seconds(), 
s.TotalCputime.Seconds(),
                                        s.AvgTput, s.MinMaxTput.Min, 
s.MinMaxTput.Max,
                                        s.AvgUtil, s.MinMaxUtil.Min, 
s.MinMaxUtil.Max)
+
+                               if level >= 2 {
+                                       for _, e := range s.Raw {
+                                               time := float64(e.Now) / SEC
+                                               fmt.Printf ("   [%8.3f] %8.3f 
%8d %12d\n", time,
+                                                       e.Cputime.Seconds(), 
e.Mops, e.MaxDelta)
+                                       }
+                               }
+
                        }
                }
        }
@@ -391,7 +411,7 @@ func (plan *BenchmarkPlan) Save() (err error) {
        return
 }
 
-func (plan *BenchmarkPlan) TextReport() (err error) {
+func (plan *BenchmarkPlan) TextReport(level int) (err error) {
        for i := range plan.Runs {
                r := &plan.Runs[i]
                if ! r.Completed {
@@ -404,7 +424,7 @@ func (plan *BenchmarkPlan) TextReport() (err error) {
                        return
                }
 
-               err = r.TextReport()
+               err = r.TextReport(level)
                if err != nil {
                        return
                }
diff --git a/main.go b/main.go
index a931567..bb46dbc 100644
--- a/main.go
+++ b/main.go
@@ -98,7 +98,7 @@ func main() {
                        os.Exit(1)
                }
        
-               err = plan.TextReport()
+               err = plan.TextReport(2)
                if err != nil {
                        fmt.Println("Running benchmark run:", err)
                        os.Exit(1)
diff --git a/run.go b/run.go
index 41408dd..259f427 100644
--- a/run.go
+++ b/run.go
@@ -39,14 +39,17 @@ func Report(ws *WorkerState, r WorkerReport) {
        lr := ws.LastReport
 
        if (lr.Now > 0) {
-               time := float64(r.Now - lr.Now) / SEC
+               time := float64(r.Now) / SEC
+               dtime := float64(r.Now - lr.Now) / SEC
                mops := r.Mops - lr.Mops
 
                tput := Throughput(lr.Now, lr.Mops, r.Now, r.Mops)
 
                util := Utilization(lr.Now, lr.Cputime, r.Now, r.Cputime)
                
-               fmt.Printf("%v Time: %2.3f Mops: %d Tput: %4.2f Cputime: %v 
Util: %4.2f\n", r.Id, time, mops, tput, r.Cputime, util);
+               fmt.Printf("%v %8.3f [%8.3f] cpu %8.3f [%8.3f] Mops: %8d [%8d] 
Tput: %4.2f Util: %4.2f\n",
+                       r.Id, time, dtime, r.Cputime.Seconds(), 
r.Cputime.Seconds() - lr.Cputime.Seconds(),
+                       r.Mops, mops, tput, util);
        }
 
        ws.LastReport = r
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.