Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

how to get the node connector statistics(ReceiveBytes& TransmitBytes) of every node

asked 2014-08-05 19:09:47 -0700

shangheng gravatar image

updated 2014-08-10 03:35:12 -0700

how to get the node connector statistics(ReceiveBytes& TransmitBytes) of every node. Below is my method, but I cannot got node connector statistics

 GetAllNodeConnectorsStatisticsInputBuilder b = new GetAllNodeConnectorsStatisticsInputBuilder();
            InstanceIdentifier<Nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();
            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
            if(nodeList != null){
                for(Node n : nodeList.getNode()){
                    InstanceIdentifier<Node> iNode = InstanceIdentifier
                                .builder(Nodes.class)
                                .child(Node.class,n.getKey())
                                .toInstance();
                    NodeRef nr = new NodeRef(iNode);
                    b.setNode(nr);
                    Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> o = portStatisticsService.getAllNodeConnectorsStatistics(b.build());
                    try{
                        RpcResult<GetAllNodeConnectorsStatisticsOutput> ro = o.get();
                        GetAllNodeConnectorsStatisticsOutput nro = ro.getResult();
                        List<NodeConnectorStatisticsAndPortNumberMap> nrolist = nro.getNodeConnectorStatisticsAndPortNumberMap();
                        if(null != nrolist){
                            for(NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatistics : nrolist){
                                nodeConnectorStatistics.getBytes();
                            }
                        }
                    }catch(Exception e){
                        e.printStackTrace();
                    }
                }
            }

there is the method that got node connector statistics from each node. In this code, O return null,

 Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> o = portStatisticsService.getAllNodeConnectorsStatistics(b.build());

and also NodeConnectorStatisticsAndPortNumberMap return null.

So I wonder know is that method getting wrong or just argument was not sending.

thanks!

edit retag flag offensive close merge delete

Comments

Hi shangheng, I am also tring to get current speed of node connector.By instantiating FlowCapableNodeConnector.But i am also getting null values.Have you succeeded in your approach. please let me know. Regards,

Ashwini_Mhatre ( 2015-01-21 21:15:05 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-08-07 13:57:12 -0700

updated 2014-08-07 13:57:31 -0700

It's a best practice to only ask one question per question. A more descriptive title would likely get more attention from people who know the domain in question. It's also likely that someone would need more info, especially for question one.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
2 followers

Stats

Asked: 2014-08-05 19:09:47 -0700

Seen: 4,809 times

Last updated: Aug 14 '14