public static MetricName join ( MetricName ... parts ) { final StringBuilder nameBuilder = new StringBuilder ( ) ; final Map < String , String > tags = new HashMap <> ( ) ; boolean first = true ; for ( MetricName part : parts ) { final String name = part . getKey ( ) ; if ( name != null && ! name . isEmpty ( ) ) { if ( first ) { first = false ; } else { nameBuilder . append ( SEPARATOR ) ; } nameBuilder . append ( name ) ; } if ( ! part . getTags ( ) . isEmpty ( ) ) tags . putAll ( part . getTags ( ) ) ; } return new MetricName ( nameBuilder . toString ( ) , tags ) ; }
Join the specified set of metric names .