import com.a.eye.skywalking.network.dependencies.io.grpc.ManagedChannel;
import com.a.eye.skywalking.network.dependencies.io.grpc.ManagedChannelBuilder;
import com.a.eye.skywalking.network.dependencies.io.grpc.stub.ClientCallStreamObserver;
import com.a.eye.skywalking.network.dependencies.io.grpc.stub.ServerCallStreamObserver;
import com.a.eye.skywalking.network.dependencies.io.grpc.stub.StreamObserver;
import com.a.eye.skywalking.network.grpc.*;

import static com.a.eye.skywalking.network.grpc.SpanStorageServiceGrpc.newStub;

public class StorageClient {
    private static ManagedChannel channel =
            ManagedChannelBuilder.forAddress("127.0.0.1", 34000).usePlaintext(true).build();

    private static SpanStorageServiceGrpc.SpanStorageServiceStub spanStorageServiceStub = newStub(channel);

    private static long endTime1 = 0;

    private static long endTime2 = 0;


    public static void main(String[] args) throws InterruptedException {
        RequestSpan requestSpan =
                RequestSpan.newBuilder().setSpanType(1).setAddress("127.0.0.1").setApplicationId("1").setCallType("1")
                        .setLevelId(0).setProcessNo("19287").setStartDate(System.currentTimeMillis()).setTraceId(
                        TraceId.newBuilder().addSegments(201611).addSegments(1478661327960L).addSegments(8504828)
                                .addSegments(2277).addSegments(53).addSegments(3).build()).setUserId("1")
                        .setViewPointId("http://localhost:8080/wwww/test/helloWorld").build();

        AckSpan ackSpan = AckSpan.newBuilder().setLevelId(0).setCost(10).setTraceId(
                TraceId.newBuilder().addSegments(201611).addSegments(1478661327960L).addSegments(8504828)
                        .addSegments(2277).addSegments(53).addSegments(3).build()).setStatusCode(0)
                .setViewpointId("http://localhost:8080/wwww/test/helloWorld").build();

        long startTime = System.currentTimeMillis();


        for (int i = 0; i < 1; i++) {
            StreamObserver<AckSpan> ackSpanStreamObserver =
                    spanStorageServiceStub.storageACKSpan(new StreamObserver<SendResult>() {
                        @Override
                        public void onNext(SendResult sendResult) {

                        }

                        @Override
                        public void onError(Throwable throwable) {
                            throwable.printStackTrace();
                        }

                        @Override
                        public void onCompleted() {
                            endTime1 = System.currentTimeMillis();
                        }
                    });
            StreamObserver<RequestSpan> requestSpanStreamObserver =
                    spanStorageServiceStub.storageRequestSpan(new StreamObserver<SendResult>() {
                        @Override
                        public void onNext(SendResult sendResult) {

                        }

                        @Override
                        public void onError(Throwable throwable) {
                            throwable.printStackTrace();
                        }

                        @Override
                        public void onCompleted() {
                            endTime2 = System.currentTimeMillis();
                        }
                    });
            for (int j = 0; j < 1; j++) {
                requestSpanStreamObserver.onNext(requestSpan);
                ackSpanStreamObserver.onNext(ackSpan);

                ClientCallStreamObserver<RequestSpan> newRequestSpanStreamObserver =
                        (ClientCallStreamObserver<RequestSpan>) requestSpanStreamObserver;
                while (!newRequestSpanStreamObserver.isReady()) {
                    Thread.sleep(1);
                }
            }

            ackSpanStreamObserver.onCompleted();
            requestSpanStreamObserver.onCompleted();


        }

        Thread.sleep(1000L);

        System.out.println("save execute in " + (endTime1 - startTime) + "ms");
        System.out.println("save execute2 in " + (endTime2 - startTime) + "ms");


        Thread.sleep(10000);

    }
}

@@ -646,24 +646,27 @@
 dress(%221
-27.0.0.1
+0.128.35.79
 %22, 34000
@@ -2003,16 +2003,22 @@
 0; i %3C 1
+000000
 ; i++) %7B
@@ -3405,16 +3405,17 @@
 0; j %3C 1
+0
 ; j++) %7B
@@ -3534,24 +3534,35 @@
 Span);%0A%0A    
+        %7D%0A%0A
             
@@ -3650,20 +3650,16 @@
         
-    
 (ClientC
@@ -3717,20 +3717,17 @@
 server;%0A
-    
+%0A
         
@@ -3792,28 +3792,24 @@
             
- 
-   
 Thread.sleep
@@ -3813,34 +3813,16 @@
 eep(1);%0A
-                %7D%0A
         
@@ -3928,24 +3928,112 @@
 pleted();%0A%0A%0A
+            if(i %25 500_000 == 0)%7B%0A                System.out.println(i);%0A            %7D%0A%0A
         %7D%0A%0A 

update test case