protected Counter createColumnFamilyCounter ( final String name ) { Counter cfCounter = Metrics . newCounter ( factory . createMetricName ( name ) ) ; if ( register ( name , cfCounter ) ) { Metrics . newGauge ( globalNameFactory . createMetricName ( name ) , new Gauge < Long > ( ) { public Long value ( ) { long total = 0 ; for ( Metric cfGauge : allColumnFamilyMetrics . get ( name ) ) { total += ( ( Counter ) cfGauge ) . count ( ) ; } return total ; } } ) ; } return cfCounter ; }
Creates a counter that will also have a global counter thats the sum of all counters across different column families