- try{
- if(flowTableStatsService != null){
- final GetFlowTablesStatisticsInputBuilder input = new GetFlowTablesStatisticsInputBuilder();
- input.setNode(targetNodeRef);
-
- Future<RpcResult<GetFlowTablesStatisticsOutput>> response = flowTableStatsService.getFlowTablesStatistics(input.build());
- recordExpectedTransaction(response.get().getResult().getTransactionId(), StatsRequestType.ALL_FLOW_TABLE);
- }
- if(flowStatsService != null){
- // FIXME: it does not make sense to trigger this before sendAllFlowTablesStatisticsRequest()
- // comes back -- we do not have any tables anyway.
- sendAggregateFlowsStatsFromAllTablesRequest();
-
- sendAllFlowsStatsFromAllTablesRequest();
- }
- if(portStatsService != null){
- sendAllNodeConnectorsStatisticsRequest();
- }
- if(groupStatsService != null){
- sendAllGroupStatisticsRequest();
- sendGroupDescriptionRequest();
- }
- if(meterStatsService != null){
- sendAllMeterStatisticsRequest();
- sendMeterConfigStatisticsRequest();
- }
- if(queueStatsService != null){
- sendAllQueueStatsFromAllNodeConnector();
- }
- } catch(Exception e) {
- logger.error("Exception occured while sending statistics requests", e);
- }
- }
-
- public synchronized void start() {
- requestPeriodicStatistics();
- }
-
- @Override
- public synchronized void close() {
- // FIXME: cleanup any resources we hold (registrations, etc.)
- logger.debug("Statistics handler for {} shut down", targetNodeKey.getId());
- }
-
- synchronized void sendFlowStatsFromTableRequest(Flow flow) throws InterruptedException, ExecutionException{
- final GetFlowStatisticsFromFlowTableInputBuilder input =
- new GetFlowStatisticsFromFlowTableInputBuilder(flow);
-
- input.setNode(targetNodeRef);
-
- Future<RpcResult<GetFlowStatisticsFromFlowTableOutput>> response =
- flowStatsService.getFlowStatisticsFromFlowTable(input.build());
-
- recordExpectedTransaction(response.get().getResult().getTransactionId(), StatsRequestType.ALL_FLOW);
- }
-
- synchronized void sendGroupDescriptionRequest() throws InterruptedException, ExecutionException{
- final GetGroupDescriptionInputBuilder input = new GetGroupDescriptionInputBuilder();
-
- input.setNode(targetNodeRef);
-
- Future<RpcResult<GetGroupDescriptionOutput>> response =
- groupStatsService.getGroupDescription(input.build());
-
- recordExpectedTransaction(response.get().getResult().getTransactionId(), StatsRequestType.GROUP_DESC);
- }
-
- synchronized void sendMeterConfigStatisticsRequest() throws InterruptedException, ExecutionException{
-
- GetAllMeterConfigStatisticsInputBuilder input = new GetAllMeterConfigStatisticsInputBuilder();
-
- input.setNode(targetNodeRef);
-
- Future<RpcResult<GetAllMeterConfigStatisticsOutput>> response =
- meterStatsService.getAllMeterConfigStatistics(input.build());