synchronized void printStats ( ) { String line1 = String . format ( "CACHE STATS - Literals: Hits %d/%d (%.1f%%), Inserts %d Evictions %d\n" , m_literalHits , m_literalQueries , ( m_literalHits * 100.0 ) / m_literalQueries , m_literalInsertions , m_literalEvictions ) ; String line2 = String . format ( "CACHE STATS - Plans: Hits %d/%d (%.1f%%), Inserts %d Evictions %d\n" , m_planHits , m_planQueries , ( m_planHits * 100.0 ) / m_planQueries , m_planInsertions , m_planEvictions ) ; System . out . print ( line1 + line2 ) ; System . out . flush ( ) ; // reset these m_literalHits = 0 ; m_literalQueries = 0 ; m_literalInsertions = 0 ; m_literalEvictions = 0 ; m_planHits = 0 ; m_planQueries = 0 ; m_planInsertions = 0 ; m_planEvictions = 0 ; }
Stats printing method used during development . Probably shouldn t live past real stats integration .