Class DefaultFormatter
- java.lang.Object
-
- com.lightbend.cinnamon.chmetrics.reporter.formatter.DefaultFormatter
-
- All Implemented Interfaces:
Formatter
public class DefaultFormatter extends java.lang.Object implements Formatter
Default formatting implementation delimits the key with dot, which is the metric key delimiter for StatsD and Graphite, and each name is encoded by replacing dots with underscores.So
List("actors", "some.package.Actor", "mailbox-size")becomes"actors.some_package_Actor.mailbox-size".The delimiter and encoding replacements can be configured. This is the default configuration:
cinnamon.chmetrics.formatter { delimiter = "." encode = [ { from = "." to = "_" }, { from = "@" to = "_" }, { from = ":" to = "_" }, { from = "/" to = "_" } ] }
-
-
Constructor Summary
Constructors Constructor Description DefaultFormatter(com.typesafe.config.Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringencode(java.lang.String name)Encode name with all configured replacements.java.lang.Stringjoin(java.util.List<java.lang.String> names)Join names into a single delimited identifier.
-