Search in sources :

Example 1 with GaugeManager

use of com.google.firebase.perf.session.gauges.GaugeManager in project firebase-android-sdk by firebase.

the class TraceTest method testTraceStartStopDoesNotTriggerSingleGaugeCollectionOnNonVerboseSession.

@Test
public void testTraceStartStopDoesNotTriggerSingleGaugeCollectionOnNonVerboseSession() {
    forceNonVerboseSession();
    GaugeManager gaugeManager = mock(GaugeManager.class);
    Trace trace = new Trace(TRACE_1, mockTransportManager, mockClock, mockAppStateMonitor, gaugeManager);
    trace.start();
    trace.stop();
    verify(gaugeManager, never()).collectGaugeMetricOnce(ArgumentMatchers.nullable(Timer.class));
}
Also used : Timer(com.google.firebase.perf.util.Timer) GaugeManager(com.google.firebase.perf.session.gauges.GaugeManager) Test(org.junit.Test)

Example 2 with GaugeManager

use of com.google.firebase.perf.session.gauges.GaugeManager in project firebase-android-sdk by firebase.

the class TraceTest method testTraceStartStopTriggerSingleGaugeCollectionOnVerboseSession.

@Test
public void testTraceStartStopTriggerSingleGaugeCollectionOnVerboseSession() {
    forceVerboseSession();
    GaugeManager gaugeManager = mock(GaugeManager.class);
    Trace trace = new Trace(TRACE_1, mockTransportManager, mockClock, mockAppStateMonitor, gaugeManager);
    trace.start();
    trace.stop();
    verify(gaugeManager, times(2)).collectGaugeMetricOnce(ArgumentMatchers.nullable(Timer.class));
}
Also used : Timer(com.google.firebase.perf.util.Timer) GaugeManager(com.google.firebase.perf.session.gauges.GaugeManager) Test(org.junit.Test)

Aggregations

GaugeManager (com.google.firebase.perf.session.gauges.GaugeManager)2 Timer (com.google.firebase.perf.util.Timer)2 Test (org.junit.Test)2