Search in sources :

Example 6 with MeasurementGroupConfig

use of org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig in project java-chassis by ServiceComb.

the class TestInvocationMetersInitializer method edgeInvocation.

@Test
public void edgeInvocation(@Mocked InvocationFinishEvent event) {
    new Expectations() {

        {
            invocation.isConsumer();
            result = true;
            invocation.isEdge();
            result = true;
            invocation.getRealTransportName();
            result = Const.RESTFUL;
            invocation.getMicroserviceQualifiedName();
            result = "m.s.o";
            invocation.getInvocationStageTrace().calcTotalTime();
            result = 9;
            invocation.getInvocationStageTrace().calcThreadPoolQueueTime();
            result = 9;
            invocation.getInvocationStageTrace().calcClientFiltersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcSendRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcGetConnectionTime();
            result = 4;
            invocation.getInvocationStageTrace().calcWriteToBufferTime();
            result = 5;
            invocation.getInvocationStageTrace().calcWakeConsumer();
            result = 9;
            invocation.getInvocationStageTrace().calcReceiveResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcClientFiltersResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcInvocationPrepareTime();
            result = 9;
            invocation.getInvocationStageTrace().calcHandlersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcHandlersResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcSendResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcServerFiltersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcServerFiltersResponseTime();
            result = 9;
            event.getInvocation();
            result = invocation;
        }
    };
    eventBus.post(event);
    eventBus.post(event);
    globalRegistry.poll(1);
    MeasurementTree tree = new MeasurementTree();
    tree.from(registry.iterator(), new MeasurementGroupConfig(MeterInvocationConst.INVOCATION_NAME));
    assertEquals("[Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=total:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=total:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=total:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=handlers_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=handlers_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=handlers_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=handlers_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=handlers_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=handlers_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=prepare:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=prepare:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=prepare:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=client_filters_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=client_filters_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=client_filters_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_send_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_send_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_send_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_get_connection:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_get_connection:statistic=totalTime:status=0:transport=rest:type=stage,0,8.0E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_get_connection:statistic=max:status=0:transport=rest:type=stage,0,4.0E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_write_to_buf:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_write_to_buf:statistic=totalTime:status=0:transport=rest:type=stage,0,1.0E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_write_to_buf:statistic=max:status=0:transport=rest:type=stage,0,5.0E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_wait_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_wait_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_wait_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_wake_consumer:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_wake_consumer:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=consumer_wake_consumer:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=client_filters_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=client_filters_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=client_filters_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=queue:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=queue:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=queue:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=server_filters_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=server_filters_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=server_filters_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=server_filters_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=server_filters_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=server_filters_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=producer_send_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=producer_send_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=EDGE:stage=producer_send_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9)]", tree.findChild(MeterInvocationConst.INVOCATION_NAME).getMeasurements().toString());
}
Also used : Expectations(mockit.Expectations) MeasurementTree(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementTree) MeasurementGroupConfig(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig) Test(org.junit.Test)

Example 7 with MeasurementGroupConfig

use of org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig in project java-chassis by ServiceComb.

the class TestInvocationMetersInitializer method consumerInvocation.

@Test
public void consumerInvocation(@Mocked InvocationFinishEvent event) {
    new Expectations() {

        {
            invocation.isConsumer();
            result = true;
            invocation.getInvocationType();
            result = InvocationType.CONSUMER;
            invocation.getRealTransportName();
            result = Const.RESTFUL;
            invocation.getMicroserviceQualifiedName();
            result = "m.s.o";
            invocation.getInvocationStageTrace().calcTotalTime();
            result = 9;
            invocation.getInvocationStageTrace().calcClientFiltersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcSendRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcGetConnectionTime();
            result = 4;
            invocation.getInvocationStageTrace().calcWriteToBufferTime();
            result = 5;
            invocation.getInvocationStageTrace().calcWakeConsumer();
            result = 9;
            invocation.getInvocationStageTrace().calcReceiveResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcClientFiltersResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcInvocationPrepareTime();
            result = 9;
            invocation.getInvocationStageTrace().calcHandlersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcHandlersResponseTime();
            result = 9;
            event.getInvocation();
            result = invocation;
        }
    };
    eventBus.post(event);
    eventBus.post(event);
    globalRegistry.poll(1);
    MeasurementTree tree = new MeasurementTree();
    tree.from(registry.iterator(), new MeasurementGroupConfig(MeterInvocationConst.INVOCATION_NAME));
    assertEquals("" + "[Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=total:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=total:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=total:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=handlers_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=handlers_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=handlers_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=handlers_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=handlers_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=handlers_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=prepare:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=prepare:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=prepare:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=client_filters_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=client_filters_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=client_filters_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_send_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_send_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_send_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_get_connection:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_get_connection:statistic=totalTime:status=0:transport=rest:type=stage,0,8.0E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_get_connection:statistic=max:status=0:transport=rest:type=stage,0,4.0E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_write_to_buf:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_write_to_buf:statistic=totalTime:status=0:transport=rest:type=stage,0,1.0E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_write_to_buf:statistic=max:status=0:transport=rest:type=stage,0,5.0E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_wait_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_wait_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_wait_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_wake_consumer:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_wake_consumer:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=consumer_wake_consumer:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=client_filters_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=client_filters_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=CONSUMER:stage=client_filters_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9)]", tree.findChild(MeterInvocationConst.INVOCATION_NAME).getMeasurements().toString());
}
Also used : Expectations(mockit.Expectations) MeasurementTree(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementTree) MeasurementGroupConfig(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig) Test(org.junit.Test)

Example 8 with MeasurementGroupConfig

use of org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig in project java-chassis by ServiceComb.

the class TestInvocationMetersInitializer method producerInvocation.

@Test
public void producerInvocation(@Mocked InvocationFinishEvent event) {
    new Expectations() {

        {
            invocation.isConsumer();
            result = false;
            invocation.getInvocationType();
            result = InvocationType.PRODUCER;
            invocation.getRealTransportName();
            result = Const.RESTFUL;
            invocation.getMicroserviceQualifiedName();
            result = "m.s.o";
            invocation.getInvocationStageTrace().calcTotalTime();
            result = 9;
            invocation.getInvocationStageTrace().calcInvocationPrepareTime();
            result = 9;
            invocation.getInvocationStageTrace().calcHandlersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcHandlersResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcThreadPoolQueueTime();
            result = 9;
            invocation.getInvocationStageTrace().calcBusinessTime();
            result = 9;
            invocation.getInvocationStageTrace().calcServerFiltersRequestTime();
            result = 9;
            invocation.getInvocationStageTrace().calcServerFiltersResponseTime();
            result = 9;
            invocation.getInvocationStageTrace().calcSendResponseTime();
            result = 9;
            event.getInvocation();
            result = invocation;
        }
    };
    eventBus.post(event);
    eventBus.post(event);
    globalRegistry.poll(1);
    MeasurementTree tree = new MeasurementTree();
    tree.from(registry.iterator(), new MeasurementGroupConfig(MeterInvocationConst.INVOCATION_NAME));
    assertEquals("" + "[Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=total:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=total:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=total:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=handlers_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=handlers_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=handlers_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=handlers_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=handlers_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=handlers_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=prepare:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=prepare:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=prepare:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=queue:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=queue:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=queue:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=execution:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=execution:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=execution:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=server_filters_request:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=server_filters_request:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=server_filters_request:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=server_filters_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=server_filters_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=server_filters_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=producer_send_response:statistic=count:status=0:transport=rest:type=stage,0,2.0), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=producer_send_response:statistic=totalTime:status=0:transport=rest:type=stage,0,1.8000000000000002E-8), " + "Measurement(servicecomb.invocation:operation=m.s.o:role=PRODUCER:stage=producer_send_response:statistic=max:status=0:transport=rest:type=stage,0,9.000000000000001E-9)]", tree.findChild(MeterInvocationConst.INVOCATION_NAME).getMeasurements().toString());
}
Also used : Expectations(mockit.Expectations) MeasurementTree(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementTree) MeasurementGroupConfig(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig) Test(org.junit.Test)

Example 9 with MeasurementGroupConfig

use of org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig in project java-chassis by ServiceComb.

the class PublishModelFactory method createMeasurementGroupConfig.

protected MeasurementGroupConfig createMeasurementGroupConfig() {
    MeasurementGroupConfig groupConfig = new MeasurementGroupConfig();
    groupConfig.addGroup(MeterInvocationConst.INVOCATION_NAME, MeterInvocationConst.TAG_ROLE, MeterInvocationConst.TAG_TRANSPORT, MeterInvocationConst.TAG_OPERATION, MeterInvocationConst.TAG_STATUS, MeterInvocationConst.TAG_TYPE, new DefaultTagFinder(MeterInvocationConst.TAG_STAGE, true), MeterInvocationConst.TAG_STATISTIC);
    // os config
    groupConfig.addGroup(OsMeter.OS_NAME, OsMeter.OS_TYPE, new DefaultTagFinder(NetMeter.INTERFACE, true), NetMeter.STATISTIC);
    groupConfig.addGroup(VertxMetersInitializer.VERTX_ENDPOINTS, VertxMetersInitializer.ENDPOINTS_TYPE, EndpointMeter.ADDRESS, EndpointMeter.STATISTIC);
    return groupConfig;
}
Also used : DefaultTagFinder(org.apache.servicecomb.foundation.metrics.publish.spectator.DefaultTagFinder) MeasurementGroupConfig(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig)

Aggregations

MeasurementGroupConfig (org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementGroupConfig)9 MeasurementTree (org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementTree)7 Expectations (mockit.Expectations)5 Test (org.junit.Test)5 DefaultTagFinder (org.apache.servicecomb.foundation.metrics.publish.spectator.DefaultTagFinder)1