@@ -10,6 +10,7 @@ import (
10
10
"fmt"
11
11
"math"
12
12
"sort"
13
+ "strings"
13
14
"time"
14
15
15
16
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/cluster"
@@ -330,13 +331,18 @@ func runAllocationBench(
330
331
}
331
332
samples := make ([]* clusterstats.ClusterStatRun , spec .samples )
332
333
334
+ t .L ().Printf ("cpu(%) means: average of (max-min) node cpu utilization across intervals" )
335
+ t .L ().Printf ("write(%) means: average of (max-min) write disk utilization across intervals" )
336
+ t .L ().Printf ("cost(gb) means: GBs sent for rebalancing operations between initial and end" )
337
+
333
338
for i := 0 ; i < spec .samples ; i ++ {
334
339
statCollector , cleanupFunc := setupAllocationBench (ctx , t , c , spec )
335
340
stats , err := runAllocationBenchSample (ctx , t , c , spec , statCollector )
336
341
if err != nil {
337
342
t .L ().PrintfCtx (ctx , "unable to collect allocation bench sample %s" , err .Error ())
338
343
} else {
339
344
samples [i ] = stats
345
+ t .L ().Printf ("sample %d: %v" , i + 1 , stats .Total )
340
346
}
341
347
// Completely wipe the cluster after each go. This avoid spurious
342
348
// results where prior information / statistics could influence the
@@ -544,11 +550,21 @@ func findMinDistanceClusterStatRun(
544
550
}
545
551
}
546
552
547
- t .L ().Printf ("Selected row(%d) %v from samples (normalized) %v" , minSample , samples [minSample ].Total , resultMatrix )
548
- t .L ().Printf ("Sample range %v" , minMaxs )
549
- t .L ().Printf ("Sample stddev %v" , stddevs )
550
- for _ , sample := range samples {
551
- t .L ().Printf ("%v" , sample .Total )
553
+ t .L ().Printf ("normalized result matrix:" )
554
+ var buf strings.Builder
555
+ for i := 0 ; i < n ; i ++ {
556
+ fmt .Fprintf (& buf , "\t sample run %v [" , i + 1 )
557
+ for j := 0 ; j < len (resultMatrix [i ]); j ++ {
558
+ if j > 0 {
559
+ fmt .Fprintf (& buf , ", " )
560
+ }
561
+ fmt .Fprintf (& buf , "%v: %.3f" , tags [j ], resultMatrix [i ][j ])
562
+ }
563
+ fmt .Fprintf (& buf , "]\n " )
552
564
}
565
+ t .L ().Printf (buf .String ())
566
+ t .L ().Printf ("selected sample %v (1-indexed) with total %v" , minSample + 1 , samples [minSample ].Total )
567
+ t .L ().Printf ("max-min differences across samples per tag: %v" , minMaxs )
568
+ t .L ().Printf ("standard deviations across samples per tag: %v" , stddevs )
553
569
return samples [minSample ], stddevs
554
570
}
0 commit comments