| 409 | } |
| 410 | |
| 411 | func printTextReport(report benchmarkReport) { |
| 412 | fmt.Printf("scenario: %s\n", report.Scenario) |
| 413 | fmt.Printf("source: %s\n", report.SourceURL) |
| 414 | fmt.Printf("runs: %d success=%d failed=%d\n", report.Repeat, report.Aggregate.SuccessfulRuns, report.Aggregate.FailedRuns) |
| 415 | fmt.Printf("wall-ms: avg=%.1f min=%d max=%d\n", report.Aggregate.AvgWallMillis, report.Aggregate.MinWallMillis, report.Aggregate.MaxWallMillis) |
| 416 | fmt.Printf("sync-elapsed-ms: avg=%.1f min=%d max=%d\n", report.Aggregate.AvgSyncElapsedMillis, report.Aggregate.MinSyncElapsedMillis, report.Aggregate.MaxSyncElapsedMillis) |
| 417 | fmt.Printf("peak-alloc-bytes: %d\n", report.Aggregate.MaxPeakAllocBytes) |
| 418 | fmt.Printf("peak-heap-inuse-bytes: %d\n", report.Aggregate.MaxPeakHeapInuseBytes) |
| 419 | if report.Aggregate.BatchedRuns > 0 { |
| 420 | fmt.Printf("batch-count: avg=%.1f min=%d max=%d batched-runs=%d\n", |
| 421 | report.Aggregate.AvgBatchCount, report.Aggregate.MinBatchCount, report.Aggregate.MaxBatchCount, report.Aggregate.BatchedRuns) |
| 422 | fmt.Printf("planned-batch-count: avg=%.1f min=%d max=%d\n", |
| 423 | report.Aggregate.AvgPlannedBatchCount, report.Aggregate.MinPlannedBatchCount, report.Aggregate.MaxPlannedBatchCount) |
| 424 | } |
| 425 | if len(report.Aggregate.RelayModes) > 0 { |
| 426 | fmt.Printf("relay-modes: %s\n", strings.Join(report.Aggregate.RelayModes, ",")) |
| 427 | } |
| 428 | for _, run := range report.Runs { |
| 429 | status := "ok" |
| 430 | if run.Error != "" { |
| 431 | status = "error=" + run.Error |
| 432 | } |
| 433 | fmt.Printf("run[%d]: wall-ms=%d relay-mode=%s batch-count=%d planned-batches=%d target=%s %s\n", |
| 434 | run.Index, run.WallMillis, run.Result.RelayMode, run.Result.BatchCount, run.Result.PlannedBatchCount, run.TargetPath, status) |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | type multiStringFlag []string |
| 439 | |