use of org.onosproject.net.device.PortStatisticsDiscovery in project onos by opennetworkinglab.
the class NetconfDeviceProvider method updatePortStatistics.
private void updatePortStatistics(Device device) {
if (device.is(PortStatisticsDiscovery.class)) {
PortStatisticsDiscovery d = device.as(PortStatisticsDiscovery.class);
Collection<PortStatistics> portStatistics = d.discoverPortStatistics();
if (portStatistics != null) {
providerService.updatePortStatistics(device.id(), portStatistics);
}
} else {
log.debug("No port statistics getter behaviour for device {}", device.id());
}
}
use of org.onosproject.net.device.PortStatisticsDiscovery in project onos by opennetworkinglab.
the class RestDeviceProvider method updatePortStatistics.
private void updatePortStatistics(DeviceId deviceId) {
Device device = deviceService.getDevice(deviceId);
checkNotNull(device, "device cannot be null");
if (device.is(PortStatisticsDiscovery.class)) {
PortStatisticsDiscovery portStatisticsDiscovery = device.as(PortStatisticsDiscovery.class);
Collection<PortStatistics> portStatistics = portStatisticsDiscovery.discoverPortStatistics();
if (portStatistics != null && !portStatistics.isEmpty()) {
providerService.updatePortStatistics(deviceId, portStatistics);
}
} else {
log.debug("No port statistics getter behaviour for device {}", deviceId);
}
}
use of org.onosproject.net.device.PortStatisticsDiscovery in project onos by opennetworkinglab.
the class StatsPoller method updatePortStatistics.
private void updatePortStatistics(DeviceId deviceId) {
final Device device = deviceService.getDevice(deviceId);
if (!device.is(PortStatisticsDiscovery.class)) {
log.error("Missing PortStatisticsDiscovery behaviour for {}", deviceId);
}
final Collection<PortStatistics> statistics = device.as(PortStatisticsDiscovery.class).discoverPortStatistics();
if (!statistics.isEmpty()) {
providerService.updatePortStatistics(deviceId, statistics);
}
}
Aggregations