Merge "Wakeup packet events: addressing a few comments" am: 67d16ec1ab

am: a35bbadeba

Change-Id: I33eeb421cff21efdaa409d27fb130ff4754ac6b0
This commit is contained in:
Hugo Benichi
2017-09-19 07:29:09 +00:00
committed by android-build-merger
7 changed files with 14 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ public class WakeupStats {
public long systemWakeups = 0;
public long nonApplicationWakeups = 0;
public long applicationWakeups = 0;
public long unroutedWakeups = 0;
public long noUidWakeups = 0;
public long durationSec = 0;
public WakeupStats(String iface) {
@@ -58,7 +58,7 @@ public class WakeupStats {
systemWakeups++;
break;
case NO_UID:
unroutedWakeups++;
noUidWakeups++;
break;
default:
if (ev.uid >= Process.FIRST_APPLICATION_UID) {
@@ -80,7 +80,7 @@ public class WakeupStats {
.append(", system: ").append(systemWakeups)
.append(", apps: ").append(applicationWakeups)
.append(", non-apps: ").append(nonApplicationWakeups)
.append(", unrouted: ").append(unroutedWakeups)
.append(", no uid: ").append(noUidWakeups)
.append(", ").append(durationSec).append("s)")
.toString();
}

View File

@@ -501,8 +501,8 @@ message WakeupStats {
// between [1001, 9999]. See android.os.Process for possible uids.
optional int64 non_application_wakeups = 6;
// The total number of wakeup packets with no associated sockets.
optional int64 unrouted_wakeups = 7;
// The total number of wakeup packets with no associated socket or uid.
optional int64 no_uid_wakeups = 7;
}
// Represents one of the IP connectivity event defined in this file.

View File

@@ -126,7 +126,7 @@ final public class IpConnectivityEventBuilder {
wakeupStats.systemWakeups = in.systemWakeups;
wakeupStats.nonApplicationWakeups = in.nonApplicationWakeups;
wakeupStats.applicationWakeups = in.applicationWakeups;
wakeupStats.unroutedWakeups = in.unroutedWakeups;
wakeupStats.noUidWakeups = in.noUidWakeups;
final IpConnectivityEvent out = buildEvent(0, 0, in.iface);
out.setWakeupStats(wakeupStats);
return out;

View File

@@ -170,11 +170,11 @@ public class NetdEventListenerService extends INetdEventListener.Stub {
timestampMs = System.currentTimeMillis();
}
addWakupEvent(iface, timestampMs, uid);
addWakeupEvent(iface, timestampMs, uid);
}
@GuardedBy("this")
private void addWakupEvent(String iface, long timestampMs, int uid) {
private void addWakeupEvent(String iface, long timestampMs, int uid) {
int index = wakeupEventIndex(mWakeupEventCursor);
mWakeupEventCursor++;
WakeupEvent event = new WakeupEvent();

View File

@@ -512,7 +512,7 @@ public class IpConnectivityEventBuilderTest {
stats.nonApplicationWakeups = 1;
stats.rootWakeups = 2;
stats.systemWakeups = 3;
stats.unroutedWakeups = 3;
stats.noUidWakeups = 3;
IpConnectivityEvent got = IpConnectivityEventBuilder.toProto(stats);
String want = String.join("\n",
@@ -526,11 +526,11 @@ public class IpConnectivityEventBuilderTest {
" wakeup_stats <",
" application_wakeups: 5",
" duration_sec: 0",
" no_uid_wakeups: 3",
" non_application_wakeups: 1",
" root_wakeups: 2",
" system_wakeups: 3",
" total_wakeups: 14",
" unrouted_wakeups: 3",
" >",
">",
"version: 2\n");

View File

@@ -423,11 +423,11 @@ public class IpConnectivityMetricsTest {
" wakeup_stats <",
" application_wakeups: 2",
" duration_sec: 0",
" no_uid_wakeups: 0",
" non_application_wakeups: 0",
" root_wakeups: 0",
" system_wakeups: 1",
" total_wakeups: 3",
" unrouted_wakeups: 0",
" >",
">",
"events <",
@@ -439,11 +439,11 @@ public class IpConnectivityMetricsTest {
" wakeup_stats <",
" application_wakeups: 1",
" duration_sec: 0",
" no_uid_wakeups: 1",
" non_application_wakeups: 0",
" root_wakeups: 0",
" system_wakeups: 2",
" total_wakeups: 4",
" unrouted_wakeups: 1",
" >",
">",
"version: 2\n");

View File

@@ -163,11 +163,11 @@ public class NetdEventListenerServiceTest {
" wakeup_stats <",
" application_wakeups: 3",
" duration_sec: 0",
" no_uid_wakeups: 0",
" non_application_wakeups: 0",
" root_wakeups: 0",
" system_wakeups: 2",
" total_wakeups: 5",
" unrouted_wakeups: 0",
" >",
">",
"events <",
@@ -179,11 +179,11 @@ public class NetdEventListenerServiceTest {
" wakeup_stats <",
" application_wakeups: 2",
" duration_sec: 0",
" no_uid_wakeups: 2",
" non_application_wakeups: 1",
" root_wakeups: 2",
" system_wakeups: 3",
" total_wakeups: 10",
" unrouted_wakeups: 2",
" >",
">",
"version: 2\n");