Hi Foli-
This is code specific to getting Queue stats from a switch using Beacon. Are you using Beacon as your OpenFlow controller? What stats are you trying to get?

-David

On 5/20/2011 11:35 PM, Gaba Foli kodjo wrote:
Hi,

I would like to get statistics from the switches. Please is there any tutorial explaining how to do this?
I have tried this piece of code that I found online:
public List<OFStatistics> getSwitchQueuesStat(IOFSwitch sw) {
        Future<List<OFStatistics>> future;
        List<OFStatistics> values = null;
if (sw != null) {
            OFStatisticsRequest req = new OFStatisticsRequest();
            OFQueueStatisticsRequest fsr = new OFQueueStatisticsRequest();
            fsr.setPortNumber(OFPort.OFPP_ALL.getValue());
            req.setStatisticType(OFStatisticsType.QUEUE);
req.setStatistics(Collections.singletonList((OFStatistics)fsr));
            req.setLengthU(req.getLengthU() + fsr.getLength());


try {
                future = sw.getStatistics(req);
                values = future.get(10, TimeUnit.SECONDS);
            } catch (Exception e) {
                System.err.println("Failure retrieving queues");
            }
log.info("stat obtained are: " + values);
        }
return values;
    }

Is it this right way to get the stats from the switches? I am also missing some jar to run this? any tips?

Thanks,

Foli


_______________________________________________
openflow-discuss mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

_______________________________________________
openflow-discuss mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to