+ PublishNotifications publisher = (PublishNotifications)message;
+ timer.start();
+
+ try {
+ publisher.publish();
+ } finally {
+ long elapsedTime = timer.elapsed(TimeUnit.MILLISECONDS);
+
+ if(elapsedTime >= ShardDataTreeNotificationPublisher.PUBLISH_DELAY_THRESHOLD_IN_MS) {
+ LOG.warn("{}: Generation of change events for {} took longer than expected. Elapsed time: {}",
+ publisher.logContext, name, timer);
+ } else {
+ LOG.debug("{}: Elapsed time for generation of change events for {}: {}", publisher.logContext,
+ name, timer);
+ }
+
+ timer.reset();
+ }