protected static < T extends GenericMetrics > List < T > getMetricsOfType ( Class < T > type ) { List < T > metricsList = ( List < T > ) registry . get ( type ) ; if ( metricsList == null ) { metricsList = new CopyOnWriteArrayList <> ( ) ; List < T > previous = ( List < T > ) registry . putIfAbsent ( type , metricsList ) ; if ( previous != null ) metricsList = previous ; } return metricsList ; }
Get all registered metrics of given Class .