debugString writes debug information to the given string builder with the given prefix.
(sb *strings.Builder, prefix string)
| 124 | // debugString writes debug information to the given string builder with the |
| 125 | // given prefix. |
| 126 | func (bm *Benchmark) debugString(sb *strings.Builder, prefix string) { |
| 127 | writeLine(sb, prefix, "Benchmark: %s", bm.Name) |
| 128 | if numConditions := len(bm.Condition); numConditions == 0 { |
| 129 | writeLine(sb, prefix, " Conditions: None.") |
| 130 | } else { |
| 131 | writeLine(sb, prefix, " Conditions (%d):", numConditions) |
| 132 | for _, condition := range bm.Condition { |
| 133 | condition.debugString(sb, prefix+" ") |
| 134 | } |
| 135 | } |
| 136 | if numMetrics := len(bm.Metric); numMetrics == 0 { |
| 137 | writeLine(sb, prefix, " Metrics: None.") |
| 138 | } else { |
| 139 | writeLine(sb, prefix, " Metrics (%d):", numMetrics) |
| 140 | for _, metric := range bm.Metric { |
| 141 | metric.debugString(sb, prefix+" ") |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | // noSpaceRe is used to remove whitespace characters in `noSpace`. |
| 147 | var noSpaceRe = regexp.MustCompile("\\s+") |
no test coverage detected