Fixed the observable collection thread pool indicator (#12087)

Co-authored-by: robin <pengrobin607@gmail.com>
This commit is contained in:
robin977 2023-04-13 14:00:31 +08:00 committed by GitHub
parent 7e3064f9b6
commit ff4c1e8672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -1129,6 +1129,7 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
return;
}
setStarted();
startMetricsCollector();
if (logger.isInfoEnabled()) {
logger.info(getIdentifier() + " is ready.");
}
@ -1146,7 +1147,12 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
}
}
private void startMetricsCollector() {
DefaultMetricsCollector collector = applicationModel.getBeanFactory().getBean(DefaultMetricsCollector.class);
if (Objects.nonNull(collector) && collector.isThreadpoolCollectEnabled()) {
collector.registryDefaultSample();
}
}
private void completeStartFuture(boolean success) {
if (startFuture != null) {
startFuture.complete(success);