joerghoh commented on a change in pull request #16:
URL:
https://github.com/apache/sling-org-apache-sling-event/pull/16#discussion_r800580337
##########
File path:
src/main/java/org/apache/sling/event/impl/jobs/scheduling/JobSchedulerImpl.java
##########
@@ -455,6 +455,14 @@ private boolean match(final ScheduledJobInfoImpl job,
final Map<String, Object>
}
return jobs;
}
+
+ /**
+ * Provide the total number of jobs registered in the system, irrespective
of topics
+ * @return the total number of scheduled jobs
+ */
+ public int getTotalNumberOfScheduledJobs() {
+ return this.scheduledJobs.size();
Review comment:
sure, to deliver precise results it would need synchronization. But this
is "just" metrics, so not always 100% accurate would be totally ok.
On the other hand I the overhead is probably very minor, because it is
expected that this map does not change a lot.
I will add this synchronization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]