Search in sources :

Example 6 with TAgentStatBatch

use of com.navercorp.pinpoint.thrift.dto.TAgentStatBatch in project pinpoint by naver.

the class AgentStatHandlerV2Test method insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull.

@Test
public void insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull() {
    // Given
    final int numBatches = 6;
    final String agentId = "agentId";
    final long startTimestamp = Long.MAX_VALUE;
    final TAgentStatBatch agentStatBatch = createAgentStatBatch(agentId, startTimestamp, numBatches);
    final AgentStatBo mappedAgentStat = null;
    when(this.agentStatBatchMapper.map(agentStatBatch)).thenReturn(mappedAgentStat);
    // When
    agentStatHandler.handle(agentStatBatch);
    // Then
    verifyZeroInteractions(jvmGcDao);
    verifyZeroInteractions(jvmGcDetailedDao);
    verifyZeroInteractions(cpuLoadDao);
    verifyZeroInteractions(transactionDao);
    verifyZeroInteractions(activeTraceDao);
    verifyZeroInteractions(dataSourceDao);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TAgentStatBatch(com.navercorp.pinpoint.thrift.dto.TAgentStatBatch) Test(org.junit.Test)

Example 7 with TAgentStatBatch

use of com.navercorp.pinpoint.thrift.dto.TAgentStatBatch in project pinpoint by naver.

the class AgentStatMonitorTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    when(agentStatCollector.collect()).thenReturn(new TAgentStat());
    this.tBaseRecorder = new TBaseRecorder<TAgentStatBatch>();
    TBaseRecorderAdaptor recorderAdaptor = new TBaseRecorderAdaptor(tBaseRecorder);
    ListenableDataSender listenableDataSender = new ListenableDataSender("testDataSender");
    listenableDataSender.setListener(recorderAdaptor);
    this.dataSender = listenableDataSender;
}
Also used : TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) TBaseRecorderAdaptor(com.navercorp.pinpoint.test.TBaseRecorderAdaptor) TAgentStatBatch(com.navercorp.pinpoint.thrift.dto.TAgentStatBatch) ListenableDataSender(com.navercorp.pinpoint.test.ListenableDataSender) Before(org.junit.Before)

Aggregations

TAgentStatBatch (com.navercorp.pinpoint.thrift.dto.TAgentStatBatch)7 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)4 Test (org.junit.Test)3 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)2 AgentStatMonitor (com.navercorp.pinpoint.profiler.monitor.AgentStatMonitor)1 DefaultAgentStatMonitor (com.navercorp.pinpoint.profiler.monitor.DefaultAgentStatMonitor)1 ListenableDataSender (com.navercorp.pinpoint.test.ListenableDataSender)1 TBaseRecorderAdaptor (com.navercorp.pinpoint.test.TBaseRecorderAdaptor)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1