Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f5b5de5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I6cccd539,Ia66cabda

* changes:
  IP connectivity metrics: introduce ConnectStatistics and DNS statistics
  IP connectivity metrics: add transport field.
parents 6cd5d2f8 7c3a7869
Loading
Loading
Loading
Loading
+88 −9
Original line number Original line Diff line number Diff line
@@ -17,6 +17,22 @@ message NetworkId {
  optional int32 network_id = 1;
  optional int32 network_id = 1;
};
};


// Transport describes a physical technology used by a network. It is a subset
// of the TRANSPORT_* constants defined in android.net.NetworkCapabilities.
enum Transport {
  UNKNOWN   = 0;
  BLUETOOTH = 1;
  CELLULAR  = 2;
  ETHERNET  = 3;
  WIFI      = 4;
};

// A pair of (key, value) integers for describing histogram-like statistics.
message Pair {
  optional int32 key = 1;
  optional int32 value = 2;
};

// Logs changes in the system default network. Changes can be 1) acquiring a
// Logs changes in the system default network. Changes can be 1) acquiring a
// default network with no previous default, 2) a switch of the system default
// default network with no previous default, 2) a switch of the system default
// network to a new default network, 3) a loss of the system default network.
// network to a new default network, 3) a loss of the system default network.
@@ -49,7 +65,8 @@ message DefaultNetworkEvent {
// This message is associated to android.net.metrics.IpReachabilityEvent.
// This message is associated to android.net.metrics.IpReachabilityEvent.
message IpReachabilityEvent {
message IpReachabilityEvent {
  // The interface name (wlan, rmnet, lo, ...) on which the probe was sent.
  // The interface name (wlan, rmnet, lo, ...) on which the probe was sent.
  optional string if_name = 1;
  // Deprecated since version 2, replaced by transport field.
  optional string if_name = 1 [deprecated = true];


  // The event type code of the probe, represented by constants defined in
  // The event type code of the probe, represented by constants defined in
  // android.net.metrics.IpReachabilityEvent.
  // android.net.metrics.IpReachabilityEvent.
@@ -93,6 +110,7 @@ message ValidationProbeEvent {


// Logs DNS lookup latencies. Repeated fields must have the same length.
// Logs DNS lookup latencies. Repeated fields must have the same length.
// This message is associated to android.net.metrics.DnsEvent.
// This message is associated to android.net.metrics.DnsEvent.
// Deprecated since version 2.
message DNSLookupBatch {
message DNSLookupBatch {
  // The id of the network on which the DNS lookups took place.
  // The id of the network on which the DNS lookups took place.
  optional NetworkId network_id = 1;
  optional NetworkId network_id = 1;
@@ -107,13 +125,62 @@ message DNSLookupBatch {
  repeated int32 latencies_ms = 4;
  repeated int32 latencies_ms = 4;
};
};


// Represents a collections of DNS lookup latencies and counters for a
// particular combination of DNS query type and return code.
// Since version 2.
message DNSLatencies {
  // The type of the DNS lookups, as defined in android.net.metrics.DnsEvent.
  // Acts as a key for a set of DNS query results.
  // Possible values are: 0 for getaddrinfo, 1 for gethostbyname.
  optional int32 type = 1;

  // The return value of the DNS resolver for the DNS lookups.
  // Acts as a key for a set of DNS query results.
  // Possible values are: 0 for success, or errno code for failures.
  optional int32 return_code = 2;

  // The number of query operations recorded.
  optional int32 query_count = 3;

  // The number of query operations returning A IPv4 records.
  optional int32 a_count = 4;

  // The number of query operations returning AAAA IPv6 records.
  optional int32 aaaa_count = 5;

  // The time it took for each DNS lookup to complete. The number of repeated
  // values can be less than query_count in case of event rate-limiting.
  repeated int32 latencies_ms = 6;
};

// Represents latency and errno statistics of the connect() system call.
// Since version 2.
message ConnectStatistics {
  // The number of connect() operations recorded.
  optional int32 connect_count = 1;

  // The number of connect() operations with IPv6 socket address.
  optional int32 ipv6_addr_count = 2;

  // The time it took for each successful connect() operation to complete.
  // The number of repeated values can be less than connect_count in case of
  // event rate-limiting.
  repeated int32 latencies_ms = 3;

  // Counts of all error values returned by failed connect() operations.
  // The Pair key field is the errno code. The Pair value field is the count
  // for that errno code.
  repeated Pair errnos_counters = 4;
};

// Represents a DHCP event on a single interface, which can be a DHCPClient
// Represents a DHCP event on a single interface, which can be a DHCPClient
// state transition or a response packet parsing error.
// state transition or a response packet parsing error.
// This message is associated to android.net.metrics.DhcpClientEvent and
// This message is associated to android.net.metrics.DhcpClientEvent and
// android.net.metrics.DhcpErrorEvent.
// android.net.metrics.DhcpErrorEvent.
message DHCPEvent {
message DHCPEvent {
  // The interface name (wlan, rmnet, lo, ...) on which the event happened.
  // The interface name (wlan, rmnet, lo, ...) on which the event happened.
  optional string if_name = 1;
  // Deprecated since version 2, replaced by transport field.
  optional string if_name = 1 [deprecated = true];


  oneof value {
  oneof value {
    // The name of a state in the DhcpClient state machine, represented by
    // The name of a state in the DhcpClient state machine, represented by
@@ -217,7 +284,8 @@ message RaEvent {
// This message is associated to android.net.metrics.IpManagerEvent.
// This message is associated to android.net.metrics.IpManagerEvent.
message IpProvisioningEvent {
message IpProvisioningEvent {
  // The interface name (wlan, rmnet, lo, ...) on which the probe was sent.
  // The interface name (wlan, rmnet, lo, ...) on which the probe was sent.
  optional string if_name = 1;
  // Deprecated since version 2, replaced by transport field.
  optional string if_name = 1 [deprecated = true];


  // The code of the IP provisioning event, represented by constants defined in
  // The code of the IP provisioning event, represented by constants defined in
  // android.net.metrics.IpManagerEvent.
  // android.net.metrics.IpManagerEvent.
@@ -228,11 +296,15 @@ message IpProvisioningEvent {
}
}


// Represents one of the IP connectivity event defined in this file.
// Represents one of the IP connectivity event defined in this file.
// Next tag: 12
// Next tag: 15
message IpConnectivityEvent {
message IpConnectivityEvent {
  // Time in ms when the event was recorded.
  // Time in ms when the event was recorded.
  optional int64 time_ms = 1;
  optional int64 time_ms = 1;


  // Physical transport of the network on which the event happened.
  // Since version 2.
  optional Transport transport = 12;

  // Event type.
  // Event type.
  oneof event {
  oneof event {


@@ -246,7 +318,14 @@ message IpConnectivityEvent {
    NetworkEvent network_event = 4;
    NetworkEvent network_event = 4;


    // A batch of DNS lookups.
    // A batch of DNS lookups.
    DNSLookupBatch dns_lookup_batch = 5;
    // Deprecated in the nyc-mr2 release since version 2, and replaced by dns_latencies.
    DNSLookupBatch dns_lookup_batch = 5 [deprecated = true];

    // DNS lookup latency statistics.
    DNSLatencies dns_latencies = 13;

    // Connect latency and errno statistics.
    ConnectStatistics connect_statistics = 14;


    // A DHCP client event or DHCP receive error.
    // A DHCP client event or DHCP receive error.
    DHCPEvent dhcp_event = 6;
    DHCPEvent dhcp_event = 6;
@@ -277,9 +356,9 @@ message IpConnectivityLog {
  optional int32 dropped_events = 2;
  optional int32 dropped_events = 2;


  // The version number of the metrics events being collected.
  // The version number of the metrics events being collected.
  //  nyc-dev: not populated, implicitly 0
  //  nyc-dev: not populated, implicitly 0.
  //  nyc-dr1: not populated, implicitly 1 (sailfish and marlin only)
  //  nyc-dr1: not populated, implicitly 1 (sailfish and marlin only).
  //  nyc-mr1: not populated, implicitly 1
  //  nyc-mr1: not populated, implicitly 1.
  //  nyc-mr2: 2
  //  nyc-mr2: 2.
  optional int32 version = 3;
  optional int32 version = 3;
};
};