Browse Source

dashboard: update InMemoryMetricsRepositoryTest

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 5 years ago
parent
commit
226589f773
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      sentinel-dashboard/src/test/java/com/alibaba/csp/sentinel/dashboard/repository/metric/InMemoryMetricsRepositoryTest.java

+ 2
- 4
sentinel-dashboard/src/test/java/com/alibaba/csp/sentinel/dashboard/repository/metric/InMemoryMetricsRepositoryTest.java View File

@@ -37,8 +37,6 @@ import static org.junit.Assert.*;
*/
public class InMemoryMetricsRepositoryTest {

private static final int AVAILABLE_CPU_PROCESSORS = Runtime.getRuntime().availableProcessors();

private static final String DEFAULT_APP = "default";
private static final String DEFAULT_EXPIRE_APP = "default_expire_app";
private static final String DEFAULT_RESOURCE = "test";
@@ -51,7 +49,7 @@ public class InMemoryMetricsRepositoryTest {
@Before
public void setUp() throws Exception {
inMemoryMetricsRepository = new InMemoryMetricsRepository();
executorService = Executors.newFixedThreadPool(AVAILABLE_CPU_PROCESSORS);
executorService = Executors.newFixedThreadPool(8);
}

@After
@@ -112,7 +110,7 @@ public class InMemoryMetricsRepositoryTest {
List<CompletableFuture> futures = Lists.newArrayList();

// concurrent query resources of app
final CyclicBarrier cyclicBarrier = new CyclicBarrier(AVAILABLE_CPU_PROCESSORS);
final CyclicBarrier cyclicBarrier = new CyclicBarrier(8);
for (int j = 0; j < 10000; j++) {
futures.add(
CompletableFuture.runAsync(() -> {


Loading…
Cancel
Save