debugString writes debug information to the given string builder with the given prefix.
(sb *strings.Builder, prefix string)
| 59 | // debugString writes debug information to the given string builder with the |
| 60 | // given prefix. |
| 61 | func (s *Suite) debugString(sb *strings.Builder, prefix string) { |
| 62 | writeLine(sb, prefix, "Benchmark suite %s:", s.Name) |
| 63 | writeLine(sb, prefix, "Timestamp: %v", s.Timestamp) |
| 64 | if !s.Official { |
| 65 | writeLine(sb, prefix, " **** NOTE: Data is not official. **** ") |
| 66 | } |
| 67 | if numConditions := len(s.Conditions); numConditions == 0 { |
| 68 | writeLine(sb, prefix, "Conditions: None.") |
| 69 | } else { |
| 70 | writeLine(sb, prefix, "Conditions (%d):", numConditions) |
| 71 | for _, condition := range s.Conditions { |
| 72 | condition.debugString(sb, prefix+" ") |
| 73 | } |
| 74 | } |
| 75 | if numBenchmarks := len(s.Benchmarks); numBenchmarks == 0 { |
| 76 | writeLine(sb, prefix, "Benchmarks: None.") |
| 77 | } else { |
| 78 | writeLine(sb, prefix, "Benchmarks (%d):", numBenchmarks) |
| 79 | for _, benchmark := range s.Benchmarks { |
| 80 | benchmark.debugString(sb, prefix+" ") |
| 81 | } |
| 82 | } |
| 83 | sb.WriteString(fmt.Sprintf("End of data for benchmark suite %s.", s.Name)) |
| 84 | } |
| 85 | |
| 86 | // Benchstat returns a benchstat-formatted output string. |
| 87 | // See https://pkg.go.dev/golang.org/x/perf/cmd/benchstat |
no test coverage detected