Search in sources :

Example 11 with StatInfo

use of com.tencent.polaris.api.plugin.stat.StatInfo in project polaris-java by polarismesh.

the class PrometheusPushHandlerTest method testPushInstanceGaugeConcurrency.

@Test
public void testPushInstanceGaugeConcurrency() throws InterruptedException {
    batchDone(() -> {
        StatInfo statInfo = new StatInfo();
        statInfo.setRouterGauge(mockServiceCallResult());
        handler.handle(statInfo);
    }, 10);
    Thread.sleep(pushInterval + 1000);
    handler.stopHandle();
}
Also used : StatInfo(com.tencent.polaris.api.plugin.stat.StatInfo) Test(org.junit.Test)

Aggregations

StatInfo (com.tencent.polaris.api.plugin.stat.StatInfo)11 Test (org.junit.Test)7 ServiceCallResult (com.tencent.polaris.api.rpc.ServiceCallResult)4 PolarisException (com.tencent.polaris.api.exception.PolarisException)2 Plugin (com.tencent.polaris.api.plugin.Plugin)2 DefaultRateLimitResult (com.tencent.polaris.api.plugin.stat.DefaultRateLimitResult)2 StatReporter (com.tencent.polaris.api.plugin.stat.StatReporter)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 IOException (java.io.IOException)1