Search in sources :

Example 6 with PerfInfo

use of org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo in project incubator-servicecomb-java-chassis by apache.

the class DefaultLogPublisher method printProducerOperationPerf.

protected void printProducerOperationPerf(OperationPerf operationPerf, StringBuilder sb) {
    PerfInfo stageTotal = operationPerf.findStage(MeterInvocationConst.STAGE_TOTAL);
    PerfInfo stageQueue = operationPerf.findStage(MeterInvocationConst.STAGE_EXECUTOR_QUEUE);
    PerfInfo stageExecution = operationPerf.findStage(MeterInvocationConst.STAGE_EXECUTION);
    sb.append(String.format("  %-7d %-11.3f %-15.3f %-9.3f %-13.3f %-11.3f %-15.3f %s\n", stageTotal.getTps(), stageTotal.calcMsLatency(), stageTotal.getMsMaxLatency(), stageQueue.calcMsLatency(), stageQueue.getMsMaxLatency(), stageExecution.calcMsLatency(), stageExecution.getMsMaxLatency(), operationPerf.getOperation()));
}
Also used : PerfInfo(org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo)

Example 7 with PerfInfo

use of org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo in project incubator-servicecomb-java-chassis by apache.

the class DefaultLogPublisher method printConsumerOperationPerf.

protected void printConsumerOperationPerf(OperationPerf operationPerf, StringBuilder sb) {
    PerfInfo stageTotal = operationPerf.findStage(MeterInvocationConst.STAGE_TOTAL);
    sb.append(String.format("  %-7d %-11.3f %-15.3f %s\n", stageTotal.getTps(), stageTotal.calcMsLatency(), stageTotal.getMsMaxLatency(), operationPerf.getOperation()));
}
Also used : PerfInfo(org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo)

Example 8 with PerfInfo

use of org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo in project incubator-servicecomb-java-chassis by apache.

the class TestPublishUtils method createPerfInfo.

@Test
public void createPerfInfo() {
    MeasurementNode stageNode = Utils.createStageNode(MeterInvocationConst.STAGE_TOTAL, 10, 10, 100);
    PerfInfo perf = PublishUtils.createPerfInfo(stageNode);
    Assert.assertEquals(10, perf.getTps());
    Assert.assertEquals(1000, perf.calcMsLatency(), 0);
    Assert.assertEquals(100000, perf.getMsMaxLatency(), 0);
}
Also used : MeasurementNode(org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementNode) PerfInfo(org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo) Test(org.junit.Test)

Aggregations

PerfInfo (org.apache.servicecomb.metrics.core.publish.model.invocation.PerfInfo)8 Test (org.junit.Test)4 MeasurementNode (org.apache.servicecomb.foundation.metrics.publish.spectator.MeasurementNode)3 OperationPerf (org.apache.servicecomb.metrics.core.publish.model.invocation.OperationPerf)3 OperationPerfGroup (org.apache.servicecomb.metrics.core.publish.model.invocation.OperationPerfGroup)2 OperationPerfGroups (org.apache.servicecomb.metrics.core.publish.model.invocation.OperationPerfGroups)2 EventBus (com.google.common.eventbus.EventBus)1 CompositeRegistry (com.netflix.spectator.api.CompositeRegistry)1 VertxImplEx (io.vertx.core.impl.VertxImplEx)1 Collections (java.util.Collections)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Status (javax.ws.rs.core.Response.Status)1 Holder (javax.xml.ws.Holder)1 Expectations (mockit.Expectations)1 Mock (mockit.Mock)1 MockUp (mockit.MockUp)1 Mocked (mockit.Mocked)1 LoggingEvent (org.apache.log4j.spi.LoggingEvent)1 Const (org.apache.servicecomb.core.Const)1