private VoltTable [ ] aggregateProcedureProfileStats ( VoltTable [ ] baseStats ) { if ( baseStats == null || baseStats . length != 1 ) { return baseStats ; } StatsProcProfTable timeTable = new StatsProcProfTable ( ) ; baseStats [ 0 ] . resetRowPosition ( ) ; while ( baseStats [ 0 ] . advanceRow ( ) ) { // Skip non-transactional procedures for some of these rollups until // we figure out how to make them less confusing. // NB: They still show up in the raw PROCEDURE stata. boolean transactional = baseStats [ 0 ] . getLong ( "TRANSACTIONAL" ) == 1 ; if ( ! transactional ) { continue ; } if ( ! baseStats [ 0 ] . getString ( "STATEMENT" ) . equalsIgnoreCase ( "<ALL>" ) ) { continue ; } String pname = baseStats [ 0 ] . getString ( "PROCEDURE" ) ; timeTable . updateTable ( ! isReadOnlyProcedure ( pname ) , baseStats [ 0 ] . getLong ( "TIMESTAMP" ) , pname , baseStats [ 0 ] . getLong ( "PARTITION_ID" ) , baseStats [ 0 ] . getLong ( "INVOCATIONS" ) , baseStats [ 0 ] . getLong ( "MIN_EXECUTION_TIME" ) , baseStats [ 0 ] . getLong ( "MAX_EXECUTION_TIME" ) , baseStats [ 0 ] . getLong ( "AVG_EXECUTION_TIME" ) , baseStats [ 0 ] . getLong ( "FAILURES" ) , baseStats [ 0 ] . getLong ( "ABORTS" ) ) ; } return new VoltTable [ ] { timeTable . sortByAverage ( "EXECUTION_TIME" ) } ; }
Produce PROCEDUREPROFILE aggregation of PROCEDURE subselector