Merge pull request #8326 from priyawadhwa/float
Round floats to one decimal point for mkcmppull/8329/head
commit
1f9896bfe2
|
@ -69,8 +69,12 @@ func (rm *resultManager) summarizeResults(binaries []*Binary, driver string) {
|
|||
fmt.Printf("**%s Driver**\n", driver)
|
||||
|
||||
for _, b := range binaries {
|
||||
fmt.Printf("Times for %s: %v\n", b.Name(), rm.totalTimes(b))
|
||||
fmt.Printf("Average time for %s: %v\n\n", b.Name(), rm.averageTime(b))
|
||||
fmt.Printf("Times for %s: ", b.Name())
|
||||
for _, tt := range rm.totalTimes(b) {
|
||||
fmt.Printf("%.1fs ", tt)
|
||||
}
|
||||
fmt.Println()
|
||||
fmt.Printf("Average time for %s: %.1fs\n\n", b.Name(), rm.averageTime(b))
|
||||
}
|
||||
|
||||
// print out summary per log
|
||||
|
@ -98,7 +102,7 @@ func (rm *resultManager) summarizeTimesPerLog(binaries []*Binary) {
|
|||
if index == -1 {
|
||||
continue
|
||||
}
|
||||
table[index][i+1] = fmt.Sprintf("%f", time)
|
||||
table[index][i+1] = fmt.Sprintf("%.1fs", time)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@ func CompareMinikubeStart(ctx context.Context, out io.Writer, binaries []*Binary
|
|||
for _, d := range drivers {
|
||||
rm, err := collectResults(ctx, binaries, d)
|
||||
if err != nil {
|
||||
log.Printf("error collecting results for %s driver: %v", d, err)
|
||||
fmt.Printf("**%s Driver**\n", d)
|
||||
fmt.Printf("error collecting results for %s driver: %v\n", d, err)
|
||||
continue
|
||||
}
|
||||
rm.summarizeResults(binaries, d)
|
||||
|
@ -50,7 +51,7 @@ func CompareMinikubeStart(ctx context.Context, out io.Writer, binaries []*Binary
|
|||
func collectResults(ctx context.Context, binaries []*Binary, driver string) (*resultManager, error) {
|
||||
rm := newResultManager()
|
||||
for run := 0; run < runs; run++ {
|
||||
log.Printf("Executing run %d/%d...", run, runs)
|
||||
log.Printf("Executing run %d/%d...", run+1, runs)
|
||||
for _, binary := range binaries {
|
||||
r, err := timeMinikubeStart(ctx, binary, driver)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue