ghenzler commented on a change in pull request #121:
URL: https://github.com/apache/felix-dev/pull/121#discussion_r759453125
##########
File path:
healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/BundlesStartedCheck.java
##########
@@ -79,78 +82,85 @@ protected void activate(BundleContext bundleContext, Config
config) {
this.includesRegex = Pattern.compile(config.includesRegex());
this.excludesRegex = StringUtils.isNotBlank(config.excludesRegex()) ?
Optional.of(Pattern.compile(config.excludesRegex())) : Optional.empty();
this.useCriticalForInactive = config.useCriticalForInactive();
- LOG.debug("Activated bundles started HC for includesRegex={}
excludesRegex={}% useCriticalForInactive={}", includesRegex, excludesRegex,
useCriticalForInactive);
+ LOG.info("Activated bundles started HC for includesRegex={}
excludesRegex={}% useCriticalForInactive={}", includesRegex, excludesRegex,
useCriticalForInactive);
}
-
@Override
public Result execute() {
FormattingResultLog log = new FormattingResultLog();
+ List<Bundle> bundles = Arrays.asList(bundleContext.getBundles());
+ AtomicLong checkedBundles = new AtomicLong();
+ long activeBundles = bundles.stream()
+ .filter(this::isIncluded)
+ .filter(this::isNotExcluded)
+ .filter(this::isNotFragment)
+ .filter(this::isNotLazyStarting)
+ .peek(bundle -> checkedBundles.incrementAndGet())
+ .filter(bundle -> isActive(log, bundle))
+ .count();
Review comment:
This stream approach is nice!
--
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]