compactorName returns a short label for whichever compaction strategy is active. Used in debug-log entries so it's obvious what ran.
()
| 187 | // compactorName returns a short label for whichever compaction strategy is |
| 188 | // active. Used in debug-log entries so it's obvious what ran. |
| 189 | func (a *Agent) compactorName() string { |
| 190 | if a.Compactor == nil { |
| 191 | return "none" |
| 192 | } |
| 193 | return fmt.Sprintf("%T", a.Compactor) |
| 194 | } |
| 195 | |
| 196 | func truncate(s string, n int) string { |
| 197 | if len(s) <= n { |