private String getStatsString ( ) { SplitTypeStats allTypeStats = splitTypeStatsMap . get ( SplitType . ALL ) ; Map < String , Map < String , Number > > statsMapMap = new HashMap < String , Map < String , Number > > ( ) ; for ( Map . Entry < SplitType , SplitTypeStats > entry : splitTypeStatsMap . entrySet ( ) ) { Map < String , Number > statsMap = new HashMap < String , Number > ( ) ; statsMapMap . put ( entry . getKey ( ) . toString ( ) , statsMap ) ; float percentTotalSplitCount = ( 100f * entry . getValue ( ) . getTotalSplitCount ( ) ) / allTypeStats . getTotalSplitCount ( ) ; float percentTotalSize = ( 100f * entry . getValue ( ) . getTotalSize ( ) ) / allTypeStats . getTotalSize ( ) ; float percentTotalBlockCount = ( 100f * entry . getValue ( ) . getTotalBlockCount ( ) ) / allTypeStats . getTotalBlockCount ( ) ; float averageSizePerSplit = ( ( float ) entry . getValue ( ) . getTotalSize ( ) ) / entry . getValue ( ) . getTotalSplitCount ( ) ; float averageHostCountPerSplit = ( ( float ) entry . getValue ( ) . getTotalHostCount ( ) ) / entry . getValue ( ) . getTotalSplitCount ( ) ; float averageBlockCountPerSplit = ( ( float ) entry . getValue ( ) . getTotalBlockCount ( ) ) / entry . getValue ( ) . getTotalSplitCount ( ) ; statsMap . put ( "totalSplitCount" , entry . getValue ( ) . getTotalSplitCount ( ) ) ; statsMap . put ( "percentTotalSplitCount" , percentTotalSplitCount ) ; statsMap . put ( "totalSize" , entry . getValue ( ) . getTotalSize ( ) ) ; statsMap . put ( "percentTotalSize" , percentTotalSize ) ; statsMap . put ( "averageSizePerSplit" , averageSizePerSplit ) ; statsMap . put ( "totalHostCount" , entry . getValue ( ) . getTotalHostCount ( ) ) ; statsMap . put ( "averageHostCountPerSplit" , averageHostCountPerSplit ) ; statsMap . put ( "totalBlockCount" , entry . getValue ( ) . getTotalBlockCount ( ) ) ; statsMap . put ( "percentTotalBlockCount" , percentTotalBlockCount ) ; statsMap . put ( "averageBlockCountPerSplit" , averageBlockCountPerSplit ) ; } return JSON . toString ( statsMapMap ) ; }
Get stats for every split type as a string