@ Override public synchronized Map < String , Collection < OutputRecord > > getAllRecords ( ) { Map < String , Collection < OutputRecord > > out = new TreeMap < String , Collection < OutputRecord > > ( ) ; for ( String recordName : bufferedData . keySet ( ) ) { RecordMap recordMap = bufferedData . get ( recordName ) ; synchronized ( recordMap ) { List < OutputRecord > records = new ArrayList < OutputRecord > ( ) ; Set < Entry < TagMap , MetricMap > > entrySet = recordMap . entrySet ( ) ; for ( Entry < TagMap , MetricMap > entry : entrySet ) { OutputRecord outRec = new OutputRecord ( entry . getKey ( ) , entry . getValue ( ) ) ; records . add ( outRec ) ; } out . put ( recordName , records ) ; } } return out ; }
Retrieves all the records managed by this MetricsContext . Useful for monitoring systems that are polling - based .