public Map < String , Object > getStats ( final boolean with_sub_queries , final boolean with_scanners ) { final Map < String , Object > map = new TreeMap < String , Object > ( ) ; for ( final Entry < QueryStat , Long > entry : overall_stats . entrySet ( ) ) { if ( entry . getKey ( ) . is_time ) { map . put ( entry . getKey ( ) . toString ( ) , DateTime . msFromNano ( entry . getValue ( ) ) ) ; } else { map . put ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) ) ; } } if ( with_sub_queries ) { final Iterator < Entry < Integer , Map < QueryStat , Long > > > it = query_stats . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final Entry < Integer , Map < QueryStat , Long > > entry = it . next ( ) ; final Map < String , Object > qs = new HashMap < String , Object > ( 1 ) ; qs . put ( String . format ( "queryIdx_%02d" , entry . getKey ( ) ) , getQueryStats ( entry . getKey ( ) , with_scanners ) ) ; map . putAll ( qs ) ; } } return map ; }
Returns measurements of the given query