Search in sources :

Example 6 with Measurement

use of com.alipay.lookout.api.Measurement in project sofa-rpc by sofastack.

the class RpcLookoutTest method testThreadPoolConfig.

/**
 * test thread pool config
 *
 * @throws Exception Exception
 */
@Test
public void testThreadPoolConfig() throws Exception {
    Metric metric = fetchWithNameAndMethod("rpc.bolt.threadpool.config", "");
    Collection<Measurement> measurements = metric.measure().measurements();
    assertTrue(measurements.size() == 1);
    for (Measurement measurement : measurements) {
        // 判断ThreadPool启动配置
        Object obj = measurement.value();
        assertEquals(30, corePoolSize.get(obj));
        assertEquals(500, maxPoolSize.get(obj));
        assertEquals(600, queueSize.get(obj));
    }
}
Also used : Measurement(com.alipay.lookout.api.Measurement) Metric(com.alipay.lookout.api.Metric) Test(org.junit.Test) ActivelyDestroyTest(com.alipay.sofa.rpc.test.ActivelyDestroyTest)

Aggregations

Measurement (com.alipay.lookout.api.Measurement)6 Metric (com.alipay.lookout.api.Metric)4 ActivelyDestroyTest (com.alipay.sofa.rpc.test.ActivelyDestroyTest)4 Test (org.junit.Test)4 Tag (com.alipay.lookout.api.Tag)2 SofaRpcException (com.alipay.sofa.rpc.core.exception.SofaRpcException)1