code: private String normalizeWhitespace(String str) {
      str = WHITESPACE_EXCEPT_SPACE_PATTERN.matcher(str).replaceAll(" ");
      str = TWO_OR_MORE_SPACES_PATTERN.matcher(str).replaceAll(" ");
      return str;
    }
docs: Make metric names a bit more human readable.
  Examples:
  "foo  bar" -> "foo bar"
  "foo\nbar" -> "foo bar"
  "foo\n\tbar" -> "foo bar"