APISonar


android.net.metrics.IpConnectivityLog.log

> android > net > metrics > IpConnectivityLog > log
android APIs net APIs metrics APIs IpConnectivityLog APIs log APIs

Example 1
public void testLoggingEvents() throws Exception {
        IpConnectivityLog logger = new IpConnectivityLog(mMockService);

        assertTrue(logger.log(1, FAKE_EV));
        assertTrue(logger.log(2, FAKE_EV));
        assertTrue(logger.log(3, FAKE_EV));

        List<ConnectivityMetricsEvent> got = verifyEvents(3);
        assertEventsEqual(expectedEvent(1), got.get(0));
        assertEventsEqual(expectedEvent(2), got.get(1));
        assertEventsEqual(expectedEvent(3), got.get(2));
    }
Example 2
private final IpConnectivityLog mMetricsLog = new IpConnectivityLog();

    private void logState(String name, int durationMs) {
        final DhcpClientEvent event = new DhcpClientEvent.Builder()
                .setMsg(name)
                .setDurationMs(durationMs)
                .build();
        mMetricsLog.log(mIfaceName, event);
    }
Example 3
private final IpConnectivityLog mMetricsLog;

    private void logApfProgramEventLocked(long now) {
        if (mLastInstallEvent == null) {
            return;
        }
        ApfProgramEvent.Builder ev = mLastInstallEvent;
        mLastInstallEvent = null;
        final long actualLifetime = now - mLastTimeInstalledProgram;
        ev.setActualLifetime(actualLifetime);
        if (actualLifetime < APF_PROGRAM_EVENT_LIFETIME_THRESHOLD) {
            return;
        }
        mMetricsLog.log(ev.build());
    }
Example 4
private final IpConnectivityLog mMetricsLog = new IpConnectivityLog();

    private void recordMetric(final int type) {
        if (mStartTimeMillis <= 0) { Log.wtf(mTag, "Start time undefined!"); }
        final long duration = SystemClock.elapsedRealtime() - mStartTimeMillis;
        mMetricsLog.log(mInterfaceName, new IpManagerEvent(type, duration));
    }
Example 5
private final IpConnectivityLog mMetricsLog;

    private void maybeLogEvaluationResult(int evtype) {
        if (mEvaluationTimer.isRunning()) {
            int[] transports = mNetworkCapabilities.getTransportTypes();
            mMetricsLog.log(mNetwork, transports,
                    new NetworkEvent(evtype, mEvaluationTimer.stop()));
            mEvaluationTimer.reset();
        }
    }
Example 6
private final IpConnectivityLog mMetricsLog = new IpConnectivityLog();

    private void logEvent(int probeType, int errorCode) {
        int eventType = probeType | (errorCode & 0xff);
        mMetricsLog.log(new IpReachabilityEvent(mInterfaceName, eventType));
    }
Example 7
private final IpConnectivityLog mMetricsLog;

    private void logValidationProbe(long durationMs, int probeType, int probeResult) {
        probeType =
                ValidationProbeEvent.makeProbeType(probeType, validationStage().isFirstValidation);
        mMetricsLog.log(new ValidationProbeEvent(mNetId, durationMs, probeType, probeResult));
    }
Example 8
private final IpConnectivityLog mMetricsLog = new IpConnectivityLog();

    private void logNudFailed(boolean lostProvisioning) {
        long duration = SystemClock.elapsedRealtime() - mLastProbeTimeMs;
        boolean isFromProbe = (duration < getProbeWakeLockDuration());
        int eventType = nudFailureEventType(isFromProbe, lostProvisioning);
        mMetricsLog.log(mInterfaceParams.name, new IpReachabilityEvent(eventType));
    }