IP connectivity metrics: update ipconnectivity.proto
This patch adds several new fields to ipconnectivity.proto for
improving APF metrics, connect metrics, and link_layer inference.
Test: build, flashed, ran $ adb shell dumpsys connmetrics list proto
updated metrics unit tests depending on proto schema
Bug: 34901696
Change-Id: I6f68e16f583a6b407f33f8a500133e100f3453c7
This commit is contained in:
@@ -43,6 +43,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
// TODO: instead of comparing textpb to textpb, parse textpb and compare proto to proto.
|
||||||
public class IpConnectivityEventBuilderTest extends TestCase {
|
public class IpConnectivityEventBuilderTest extends TestCase {
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -58,8 +59,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" default_network_event <",
|
" default_network_event <",
|
||||||
" network_id <",
|
" network_id <",
|
||||||
" network_id: 102",
|
" network_id: 102",
|
||||||
@@ -89,8 +93,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" dhcp_event <",
|
" dhcp_event <",
|
||||||
" duration_ms: 192",
|
" duration_ms: 192",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
@@ -112,8 +119,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" dhcp_event <",
|
" dhcp_event <",
|
||||||
" duration_ms: 0",
|
" duration_ms: 0",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
@@ -137,8 +147,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" dns_lookup_batch <",
|
" dns_lookup_batch <",
|
||||||
" event_types: 1",
|
" event_types: 1",
|
||||||
" event_types: 1",
|
" event_types: 1",
|
||||||
@@ -185,8 +198,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" ip_provisioning_event <",
|
" ip_provisioning_event <",
|
||||||
" event_type: 1",
|
" event_type: 1",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
@@ -208,8 +224,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" ip_reachability_event <",
|
" ip_reachability_event <",
|
||||||
" event_type: 512",
|
" event_type: 512",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
@@ -231,8 +250,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" network_event <",
|
" network_event <",
|
||||||
" event_type: 5",
|
" event_type: 5",
|
||||||
" latency_ms: 20410",
|
" latency_ms: 20410",
|
||||||
@@ -258,8 +280,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" validation_probe_event <",
|
" validation_probe_event <",
|
||||||
" latency_ms: 40730",
|
" latency_ms: 40730",
|
||||||
" network_id <",
|
" network_id <",
|
||||||
@@ -287,11 +312,15 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" apf_program_event <",
|
" apf_program_event <",
|
||||||
" current_ras: 9",
|
" current_ras: 9",
|
||||||
" drop_multicast: true",
|
" drop_multicast: true",
|
||||||
|
" effective_lifetime: 0",
|
||||||
" filtered_ras: 7",
|
" filtered_ras: 7",
|
||||||
" has_ipv4_addr: true",
|
" has_ipv4_addr: true",
|
||||||
" lifetime: 200",
|
" lifetime: 200",
|
||||||
@@ -319,8 +348,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" apf_statistics <",
|
" apf_statistics <",
|
||||||
" dropped_ras: 2",
|
" dropped_ras: 2",
|
||||||
" duration_ms: 45000",
|
" duration_ms: 45000",
|
||||||
@@ -328,6 +360,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
" max_program_size: 2048",
|
" max_program_size: 2048",
|
||||||
" parse_errors: 2",
|
" parse_errors: 2",
|
||||||
" program_updates: 4",
|
" program_updates: 4",
|
||||||
|
" program_updates_all: 0",
|
||||||
|
" program_updates_allowing_multicast: 0",
|
||||||
" received_ras: 10",
|
" received_ras: 10",
|
||||||
" zero_lifetime_ras: 1",
|
" zero_lifetime_ras: 1",
|
||||||
" >",
|
" >",
|
||||||
@@ -351,8 +385,11 @@ public class IpConnectivityEventBuilderTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 1",
|
" time_ms: 1",
|
||||||
|
" transports: 0",
|
||||||
" ra_event <",
|
" ra_event <",
|
||||||
" dnssl_lifetime: -1",
|
" dnssl_lifetime: -1",
|
||||||
" prefix_preferred_lifetime: 300",
|
" prefix_preferred_lifetime: 300",
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
public void testEndToEndLogging() {
|
public void testEndToEndLogging() {
|
||||||
|
// TODO: instead of comparing textpb to textpb, parse textpb and compare proto to proto.
|
||||||
IpConnectivityLog logger = new IpConnectivityLog(mService.impl);
|
IpConnectivityLog logger = new IpConnectivityLog(mService.impl);
|
||||||
|
|
||||||
Parcelable[] events = {
|
Parcelable[] events = {
|
||||||
@@ -158,16 +159,22 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
String want = joinLines(
|
String want = joinLines(
|
||||||
"dropped_events: 0",
|
"dropped_events: 0",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 100",
|
" time_ms: 100",
|
||||||
|
" transports: 0",
|
||||||
" ip_reachability_event <",
|
" ip_reachability_event <",
|
||||||
" event_type: 512",
|
" event_type: 512",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
" >",
|
" >",
|
||||||
">",
|
">",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 200",
|
" time_ms: 200",
|
||||||
|
" transports: 0",
|
||||||
" dhcp_event <",
|
" dhcp_event <",
|
||||||
" duration_ms: 192",
|
" duration_ms: 192",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
@@ -175,8 +182,11 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
" >",
|
" >",
|
||||||
">",
|
">",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 300",
|
" time_ms: 300",
|
||||||
|
" transports: 0",
|
||||||
" default_network_event <",
|
" default_network_event <",
|
||||||
" network_id <",
|
" network_id <",
|
||||||
" network_id: 102",
|
" network_id: 102",
|
||||||
@@ -191,8 +201,11 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
" >",
|
" >",
|
||||||
">",
|
">",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 400",
|
" time_ms: 400",
|
||||||
|
" transports: 0",
|
||||||
" ip_provisioning_event <",
|
" ip_provisioning_event <",
|
||||||
" event_type: 1",
|
" event_type: 1",
|
||||||
" if_name: \"wlan0\"",
|
" if_name: \"wlan0\"",
|
||||||
@@ -200,8 +213,11 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
" >",
|
" >",
|
||||||
">",
|
">",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 500",
|
" time_ms: 500",
|
||||||
|
" transports: 0",
|
||||||
" validation_probe_event <",
|
" validation_probe_event <",
|
||||||
" latency_ms: 40730",
|
" latency_ms: 40730",
|
||||||
" network_id <",
|
" network_id <",
|
||||||
@@ -212,8 +228,11 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
" >",
|
" >",
|
||||||
">",
|
">",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 600",
|
" time_ms: 600",
|
||||||
|
" transports: 0",
|
||||||
" apf_statistics <",
|
" apf_statistics <",
|
||||||
" dropped_ras: 2",
|
" dropped_ras: 2",
|
||||||
" duration_ms: 45000",
|
" duration_ms: 45000",
|
||||||
@@ -221,13 +240,18 @@ public class IpConnectivityMetricsTest extends TestCase {
|
|||||||
" max_program_size: 2048",
|
" max_program_size: 2048",
|
||||||
" parse_errors: 2",
|
" parse_errors: 2",
|
||||||
" program_updates: 4",
|
" program_updates: 4",
|
||||||
|
" program_updates_all: 0",
|
||||||
|
" program_updates_allowing_multicast: 0",
|
||||||
" received_ras: 10",
|
" received_ras: 10",
|
||||||
" zero_lifetime_ras: 1",
|
" zero_lifetime_ras: 1",
|
||||||
" >",
|
" >",
|
||||||
">",
|
">",
|
||||||
"events <",
|
"events <",
|
||||||
|
" if_name: \"\"",
|
||||||
" link_layer: 0",
|
" link_layer: 0",
|
||||||
|
" network_id: 0",
|
||||||
" time_ms: 700",
|
" time_ms: 700",
|
||||||
|
" transports: 0",
|
||||||
" ra_event <",
|
" ra_event <",
|
||||||
" dnssl_lifetime: -1",
|
" dnssl_lifetime: -1",
|
||||||
" prefix_preferred_lifetime: 300",
|
" prefix_preferred_lifetime: 300",
|
||||||
|
|||||||
@@ -213,9 +213,13 @@ public class NetdEventListenerServiceTest extends TestCase {
|
|||||||
|
|
||||||
IpConnectivityEvent got = events.get(0);
|
IpConnectivityEvent got = events.get(0);
|
||||||
String want = String.join("\n",
|
String want = String.join("\n",
|
||||||
|
"if_name: \"\"",
|
||||||
"link_layer: 0",
|
"link_layer: 0",
|
||||||
|
"network_id: 0",
|
||||||
"time_ms: 0",
|
"time_ms: 0",
|
||||||
|
"transports: 0",
|
||||||
"connect_statistics <",
|
"connect_statistics <",
|
||||||
|
" connect_blocking_count: 0",
|
||||||
" connect_count: 12",
|
" connect_count: 12",
|
||||||
" errnos_counters <",
|
" errnos_counters <",
|
||||||
" key: 1",
|
" key: 1",
|
||||||
|
|||||||
Reference in New Issue
Block a user