Add more fields to LooperStats atom

Test: Manual
Bug: 113651685
Change-Id: I7b2b64bf939310627f0659e0656aa86d0fc79e96
This commit is contained in:
Marcin Oczeretko
2018-10-02 13:00:38 +01:00
parent 355f1c0b7b
commit c06331adee
2 changed files with 32 additions and 2 deletions

View File

@@ -2556,8 +2556,7 @@ message LooperStats {
// recorded_message_count.
//
// If recorded_message_count is different than message_count, it means data
// collection has been sampled. All the fields below will be sampled in this
// case.
// collection has been sampled. The fields below will be sampled in this case.
optional int64 recorded_message_count = 7;
// Total latency of all processed messages.
@@ -2573,6 +2572,32 @@ message LooperStats {
// True if the screen was interactive PowerManager#isInteractive at the end of the call.
optional bool screen_interactive = 10;
// Max recorded CPU usage of all processed messages.
optional int64 recorded_max_cpu_micros = 11;
// Max recorded latency of all processed messages.
optional int64 recorded_max_latency_micros = 12;
// Total number of messages we tracked the dispatching delay for. If we
// collected data for all the messages, message_count will be equal to
// recorded_delay_message_count.
//
// If recorded_delay_message_count is different than message_count, it means data
// collection has been sampled or/and not all messages specified the target dispatch time.
// The fields below will be sampled in this case.
optional int64 recorded_delay_message_count = 13;
// Total dispatching delay of all processed messages.
// Calculated as a difference between the target dispatching time (Message.when)
// and the actual dispatching time.
// Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
optional int64 recorded_total_delay_millis = 14;
// Max dispatching delay of all processed messages.
// Calculated as a difference between the target dispatching time (Message.when)
// and the actual dispatching time.
optional int64 recorded_max_delay_millis = 15;
}
/**

View File

@@ -1056,6 +1056,11 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
e.writeLong(entry.totalLatencyMicros);
e.writeLong(entry.cpuUsageMicros);
e.writeBoolean(entry.isInteractive);
e.writeLong(entry.maxCpuUsageMicros);
e.writeLong(entry.maxLatencyMicros);
e.writeLong(entry.recordedDelayMessageCount);
e.writeLong(entry.delayMillis);
e.writeLong(entry.maxDelayMillis);
pulledData.add(e);
}
}