add protobuf serializer, spi extension
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-02-09 17:36:11 +08:00
parent 9d72433199
commit 5db4dbeba5
37 changed files with 1123 additions and 343 deletions

View File

@@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory;
import java.util.concurrent.CountDownLatch;
/**
* 异步请求压测
* 压测
*
* @author ehlxr
*/

View File

@@ -1,13 +1,10 @@
package io.github.ehlxr.did;
import io.github.ehlxr.did.client.SdkClient;
import io.github.ehlxr.did.common.Try;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
/**
@@ -37,16 +34,16 @@ public class DidSdkTest {
System.out.println("invokeync test finish");
// 测试异步请求
final CountDownLatch countDownLatch = new CountDownLatch(NUM);
IntStream.range(0, NUM).parallel().forEach(i ->
Try.of(() -> client.invokeAsync(responseFuture -> {
System.out.println(responseFuture.getSdkProto());
countDownLatch.countDown();
})).trap(Throwable::printStackTrace).run());
//noinspection ResultOfMethodCallIgnored
countDownLatch.await(10, TimeUnit.SECONDS);
System.out.println("invokeAsync test finish");
// final CountDownLatch countDownLatch = new CountDownLatch(NUM);
// IntStream.range(0, NUM).parallel().forEach(i ->
// Try.of(() -> client.invokeAsync(responseFuture -> {
// System.out.println(responseFuture.getSdkProto());
// countDownLatch.countDown();
// })).trap(Throwable::printStackTrace).run());
//
// //noinspection ResultOfMethodCallIgnored
// countDownLatch.await(10, TimeUnit.SECONDS);
// System.out.println("invokeAsync test finish");
}
@Test