public static String stripInstanceAndHost ( String metricsName ) { String [ ] pieces = metricsName . split ( "\\." ) ; Preconditions . checkArgument ( pieces . length > 1 , "Incorrect metrics name: %s." , metricsName ) ; // Master metrics doesn't have hostname included. if ( ! pieces [ 0 ] . equals ( MetricsSystem . InstanceType . MASTER . toString ( ) ) ) { pieces [ 1 ] = null ; } pieces [ 0 ] = null ; return Joiner . on ( "." ) . skipNulls ( ) . join ( pieces ) ; }
Removes the instance and host from the given metric name returning the result .