Search in sources :

Example 41 with ConnectivityMetricsEvent

use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityEventBuilderTest method testApfProgramEventSerialization.

@SmallTest
public void testApfProgramEventSerialization() {
    ConnectivityMetricsEvent ev = describeIpEvent(aType(ApfProgramEvent.class), aLong(200), anInt(7), anInt(9), anInt(2048), anInt(3));
    String want = joinLines("dropped_events: 0", "events <", "  time_ms: 1", "  transport: 0", "  apf_program_event <", "    current_ras: 9", "    drop_multicast: true", "    filtered_ras: 7", "    has_ipv4_addr: true", "    lifetime: 200", "    program_length: 2048", "  >", ">", "version: 2");
    verifySerialization(want, ev);
}
Also used : ApfProgramEvent(android.net.metrics.ApfProgramEvent) ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent) MetricsTestUtil.aString(com.android.server.connectivity.MetricsTestUtil.aString) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 42 with ConnectivityMetricsEvent

use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityEventBuilderTest method testDefaultNetworkEventSerialization.

@SmallTest
public void testDefaultNetworkEventSerialization() {
    ConnectivityMetricsEvent ev = describeIpEvent(aType(DefaultNetworkEvent.class), anInt(102), anIntArray(1, 2, 3), anInt(101), aBool(true), aBool(false));
    String want = joinLines("dropped_events: 0", "events <", "  time_ms: 1", "  transport: 0", "  default_network_event <", "    network_id <", "      network_id: 102", "    >", "    previous_network_id <", "      network_id: 101", "    >", "    previous_network_ip_support: 1", "    transport_types: 1", "    transport_types: 2", "    transport_types: 3", "  >", ">", "version: 2");
    verifySerialization(want, ev);
}
Also used : DefaultNetworkEvent(android.net.metrics.DefaultNetworkEvent) ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent) MetricsTestUtil.aString(com.android.server.connectivity.MetricsTestUtil.aString) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 43 with ConnectivityMetricsEvent

use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityEventBuilderTest method testNetworkEventSerialization.

@SmallTest
public void testNetworkEventSerialization() {
    ConnectivityMetricsEvent ev = describeIpEvent(aType(NetworkEvent.class), anInt(100), anInt(5), aLong(20410));
    String want = joinLines("dropped_events: 0", "events <", "  time_ms: 1", "  transport: 0", "  network_event <", "    event_type: 5", "    latency_ms: 20410", "    network_id <", "      network_id: 100", "    >", "  >", ">", "version: 2");
    verifySerialization(want, ev);
}
Also used : NetworkEvent(android.net.metrics.NetworkEvent) DefaultNetworkEvent(android.net.metrics.DefaultNetworkEvent) ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent) MetricsTestUtil.aString(com.android.server.connectivity.MetricsTestUtil.aString) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 44 with ConnectivityMetricsEvent

use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityEventBuilderTest method testValidationProbeEventSerialization.

@SmallTest
public void testValidationProbeEventSerialization() {
    ConnectivityMetricsEvent ev = describeIpEvent(aType(ValidationProbeEvent.class), anInt(120), aLong(40730), anInt(ValidationProbeEvent.PROBE_HTTP), anInt(204));
    String want = joinLines("dropped_events: 0", "events <", "  time_ms: 1", "  transport: 0", "  validation_probe_event <", "    latency_ms: 40730", "    network_id <", "      network_id: 120", "    >", "    probe_result: 204", "    probe_type: 1", "  >", ">", "version: 2");
    verifySerialization(want, ev);
}
Also used : ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent) ValidationProbeEvent(android.net.metrics.ValidationProbeEvent) MetricsTestUtil.aString(com.android.server.connectivity.MetricsTestUtil.aString) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 45 with ConnectivityMetricsEvent

use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityEventBuilderTest method testDhcpErrorEventSerialization.

@SmallTest
public void testDhcpErrorEventSerialization() {
    ConnectivityMetricsEvent ev = describeIpEvent(aType(DhcpErrorEvent.class), aString("wlan0"), anInt(DhcpErrorEvent.L4_NOT_UDP));
    String want = joinLines("dropped_events: 0", "events <", "  time_ms: 1", "  transport: 0", "  dhcp_event <", "    duration_ms: 0", "    if_name: \"wlan0\"", "    error_code: 50397184", "  >", ">", "version: 2");
    verifySerialization(want, ev);
}
Also used : ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent) MetricsTestUtil.aString(com.android.server.connectivity.MetricsTestUtil.aString) DhcpErrorEvent(android.net.metrics.DhcpErrorEvent) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

ConnectivityMetricsEvent (android.net.ConnectivityMetricsEvent)63 MetricsTestUtil.aString (com.android.server.connectivity.MetricsTestUtil.aString)44 SmallTest (android.test.suitebuilder.annotation.SmallTest)39 DefaultNetworkEvent (android.net.metrics.DefaultNetworkEvent)8 IpConnectivityLog (android.net.metrics.IpConnectivityLog)8 Reference (android.net.ConnectivityMetricsEvent.Reference)6 IpConnectivityEvent (com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent)5 ArrayList (java.util.ArrayList)5 ApfProgramEvent (android.net.metrics.ApfProgramEvent)4 ApfStats (android.net.metrics.ApfStats)4 DhcpClientEvent (android.net.metrics.DhcpClientEvent)4 DhcpErrorEvent (android.net.metrics.DhcpErrorEvent)4 DnsEvent (android.net.metrics.DnsEvent)4 IpManagerEvent (android.net.metrics.IpManagerEvent)4 IpReachabilityEvent (android.net.metrics.IpReachabilityEvent)4 NetworkEvent (android.net.metrics.NetworkEvent)4 RaEvent (android.net.metrics.RaEvent)4 ValidationProbeEvent (android.net.metrics.ValidationProbeEvent)4 FileDescriptor (java.io.FileDescriptor)3 FileOutputStream (java.io.FileOutputStream)3