public void updateScannerStat ( final int query_index , final int id , final QueryStat name , final long value ) { Map < Integer , Map < QueryStat , Long > > qs = scanner_stats . get ( query_index ) ; long cum_time = value ; if ( qs == null ) { qs = new ConcurrentHashMap < Integer , Map < QueryStat , Long > > ( ) ; scanner_stats . put ( query_index , qs ) ; } Map < QueryStat , Long > scanner_stat_map = qs . get ( id ) ; if ( scanner_stat_map == null ) { scanner_stat_map = new HashMap < QueryStat , Long > ( ) ; qs . put ( id , scanner_stat_map ) ; } if ( scanner_stat_map . containsKey ( name ) ) { cum_time += scanner_stat_map . get ( name ) ; } scanner_stat_map . put ( name , cum_time ) ; }
Updates or adds a stat for a specific scanner . IF it s a time it must be in nanoseconds