use of org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.ios.xr.ip._static.cfg.rev130722.VRFPREFIXTABLE in project netconf by opendaylight.
the class NotificationsCounter method onNotification.
@Override
public void onNotification(@NonNull DOMNotification domNotification) {
final long andDecrement = notifCounter.getAndDecrement();
if (andDecrement == expectedNotificationCount) {
this.stopWatch = Stopwatch.createStarted();
LOG.info("First notification received at {}", stopWatch);
}
LOG.debug("Notification received, {} to go.", andDecrement);
if (LOG.isTraceEnabled()) {
LOG.trace("Notification received: {}", domNotification);
}
final Notification notification = serializer.fromNormalizedNodeNotification(domNotification.getType(), domNotification.getBody());
if (notification instanceof VRFPREFIXTABLE) {
totalPrefixesReceived += ((VRFPREFIXTABLE) notification).getVrfPrefixes().getVrfPrefix().size();
}
if (andDecrement == 1) {
this.stopWatch.stop();
LOG.info("Last notification received at {}", stopWatch);
LOG.info("Elapsed ms for {} notifications: {}", expectedNotificationCount, stopWatch.elapsed(TimeUnit.MILLISECONDS));
LOG.info("Performance (notifications/second): {}", (expectedNotificationCount * 1.0 / stopWatch.elapsed(TimeUnit.MILLISECONDS)) * 1000);
LOG.info("Performance (prefixes/second): {}", (totalPrefixesReceived * 1.0 / stopWatch.elapsed(TimeUnit.MILLISECONDS)) * 1000);
}
}
Aggregations