Skip to content

Commit

Permalink
Merge branch 'sofastack:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JAYDIPSINH27 committed Mar 16, 2024
2 parents 1bd24f4 + 2e8af92 commit 1790b70
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions sofa-boot-project/sofa-boot-actuator-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>runtime-sofa-boot</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public void start() {
StringBuilder sb = new StringBuilder();
sb.append("coreSize:" + threadPoolExecutor.getCorePoolSize() + ",");
sb.append("maxPoolSize:" + threadPoolExecutor.getMaximumPoolSize() + ",");
sb.append("queueRemainingSize:"
+ threadPoolExecutor.getQueue().remainingCapacity() + ",");
sb.append("keepAliveTime:"
+ threadPoolExecutor.getKeepAliveTime(TimeUnit.MILLISECONDS)
+ "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

import org.springframework.core.annotation.AnnotationAwareOrderComparator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;

/**
Expand All @@ -31,7 +30,7 @@
*/
public class JvmFilterHolder {

private final List<JvmFilter> JVM_FILTERS = new ArrayList<>();
private final List<JvmFilter> JVM_FILTERS = new CopyOnWriteArrayList<>();

private final AtomicBoolean FILTERS_SORTED = new AtomicBoolean(false);

Expand All @@ -56,8 +55,8 @@ public List<JvmFilter> getJvmFilters() {
}

public static boolean beforeInvoking(JvmFilterContext context) {
List<JvmFilter> filters = Collections.unmodifiableList(context.getSofaRuntimeContext()
.getJvmFilterHolder().getJvmFilters());
List<JvmFilter> filters = context.getSofaRuntimeContext().getJvmFilterHolder()
.getJvmFilters();
for (JvmFilter filter : filters) {
if (!filter.before(context)) {
return false;
Expand All @@ -67,8 +66,8 @@ public static boolean beforeInvoking(JvmFilterContext context) {
}

public static boolean afterInvoking(JvmFilterContext context) {
List<JvmFilter> filters = Collections.unmodifiableList(context.getSofaRuntimeContext()
.getJvmFilterHolder().getJvmFilters());
List<JvmFilter> filters = context.getSofaRuntimeContext().getJvmFilterHolder()
.getJvmFilters();
for (int i = filters.size() - 1; i >= 0; --i) {
if (!filters.get(i).after(context)) {
return false;
Expand Down

0 comments on commit 1790b70

Please sign in to comment.