public class MetricMangler extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MetricMangler.MetricComponents
Simple struct to store and return both the source and the updated metric.
|
| Constructor and Description |
|---|
MetricMangler(String sourceFields,
String delimiters,
String removeFields)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MetricMangler.MetricComponents |
extractComponents(String metric)
Extracts the source from the metric name and returns the new metric name and the source name.
|
public MetricMangler(@Nullable String sourceFields, @Nullable String delimiters, @Nullable String removeFields)
sourceFields - comma separated field index(es) (1-based) where the source name will be
extracteddelimiters - characters to be interpreted as dotsremoveFields - comma separated field index(es) (1-based) of fields to remove from the
metric nameIllegalArgumentException - when one of the field index is <= 0public MetricMangler.MetricComponents extractComponents(String metric)
metric - the metric nameIllegalArgumentException - when the number of segments (split on '.') is less than the
maximum source component indexCopyright © 2017. All rights reserved.