public int compareByAvg ( ProcProfRow lhs , ProcProfRow rhs ) { if ( lhs . avg * lhs . invocations > rhs . avg * rhs . invocations ) { return 1 ; } else if ( lhs . avg * lhs . invocations < rhs . avg * rhs . invocations ) { return - 1 ; } else { return 0 ; } }
Sort by average weighting the sampled average by the real invocation count .