Skip to content

Commit 48231f6

Browse files
HzjNeverStop致节
andauthored
skip low cost spring.context.config-classes.enhance and bean-factory.post-process in startup actuator result (#1270)
Co-authored-by: 致节 <[email protected]>
1 parent 6502669 commit 48231f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sofa-boot-project/sofa-boot/src/main/java/com/alipay/sofa/boot/startup/StartupReporter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public class StartupReporter {
5353

5454
public static final String SPRING_CONTEXT_BEAN_FACTORY_POST_PROCESSOR = "spring.context.bean-factory.post-process";
5555

56+
public static final String SPRING_CONFIG_CLASSES_ENHANCE = "spring.context.config-classes.enhance";
57+
5658
public static final Collection<String> SPRING_BEAN_INSTANTIATE_TYPES = Set
5759
.of(SPRING_BEANS_INSTANTIATE,
5860
SPRING_BEANS_SMART_INSTANTIATE);
@@ -61,6 +63,9 @@ public class StartupReporter {
6163
.of(SPRING_CONTEXT_BEANDEF_REGISTRY_POST_PROCESSOR,
6264
SPRING_CONTEXT_BEAN_FACTORY_POST_PROCESSOR);
6365

66+
public static final Collection<String> SPRING_CONFIG_CLASSES_ENHANCE_TYPES = Set
67+
.of(SPRING_CONFIG_CLASSES_ENHANCE);
68+
6469
private final StartupStaticsModel startupStaticsModel;
6570

6671
private final List<BeanStatCustomizer> beanStatCustomizers;
@@ -216,7 +221,9 @@ public List<BeanStat> generateBeanStats(ConfigurableApplicationContext context)
216221

217222
private boolean filterBeanInitializeByCost(BeanStat beanStat) {
218223
String name = beanStat.getType();
219-
if (SPRING_BEAN_INSTANTIATE_TYPES.contains(name)) {
224+
if (SPRING_BEAN_INSTANTIATE_TYPES.contains(name)
225+
|| SPRING_CONTEXT_POST_PROCESSOR_TYPES.contains(name)
226+
|| SPRING_CONFIG_CLASSES_ENHANCE_TYPES.contains(name)) {
220227
return beanStat.getCost() >= costThreshold;
221228
} else {
222229
return true;

0 commit comments

Comments
 (0)