Proc stats UI improvements.
Now have a chart showing the memory state, and text showing the current memory state. Trying to do better at picking the application to blame for a process hosting multiple apps. Start of infrastructure for more detailed reporting. Change-Id: I93ca7ecf2fd0bc01e3be8d28b80212ac78fe7607
This commit is contained in:
@@ -18,7 +18,9 @@ package com.android.settings.applications;
|
||||
|
||||
import com.android.internal.app.ProcessStats;
|
||||
|
||||
public class ProcStatsEntry {
|
||||
import java.util.ArrayList;
|
||||
|
||||
public final class ProcStatsEntry {
|
||||
final String mPackage;
|
||||
final int mUid;
|
||||
final String mName;
|
||||
@@ -27,7 +29,10 @@ public class ProcStatsEntry {
|
||||
final long mAvgPss;
|
||||
final long mWeight;
|
||||
|
||||
ProcStatsEntry(ProcessStats.ProcessState proc, ProcessStats.ProcessDataCollection tmpTotals) {
|
||||
ArrayList<Service> mServices;
|
||||
|
||||
public ProcStatsEntry(ProcessStats.ProcessState proc,
|
||||
ProcessStats.ProcessDataCollection tmpTotals) {
|
||||
ProcessStats.computeProcessData(proc, tmpTotals, 0);
|
||||
mPackage = proc.mPackage;
|
||||
mUid = proc.mUid;
|
||||
@@ -37,4 +42,35 @@ public class ProcStatsEntry {
|
||||
mAvgPss = tmpTotals.avgPss;
|
||||
mWeight = mDuration * mAvgPss;
|
||||
}
|
||||
|
||||
public void addServices(ProcessStats.PackageState pkgState) {
|
||||
for (int isvc=0, NSVC=pkgState.mServices.size(); isvc<NSVC; isvc++) {
|
||||
ProcessStats.ServiceState svc = pkgState.mServices.valueAt(isvc);
|
||||
// XXX can't tell what process it is in!
|
||||
if (mServices == null) {
|
||||
mServices = new ArrayList<Service>();
|
||||
}
|
||||
mServices.add(new Service(svc));
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Service {
|
||||
final String mPackage;
|
||||
final String mName;
|
||||
final long mDuration;
|
||||
|
||||
public Service(ProcessStats.ServiceState service) {
|
||||
mPackage = service.mPackage;
|
||||
mName = service.mName;
|
||||
mDuration = ProcessStats.dumpSingleServiceTime(null, null, service,
|
||||
ProcessStats.ServiceState.SERVICE_STARTED,
|
||||
ProcessStats.STATE_NOTHING, 0, 0)
|
||||
+ ProcessStats.dumpSingleServiceTime(null, null, service,
|
||||
ProcessStats.ServiceState.SERVICE_BOUND,
|
||||
ProcessStats.STATE_NOTHING, 0, 0)
|
||||
+ ProcessStats.dumpSingleServiceTime(null, null, service,
|
||||
ProcessStats.ServiceState.SERVICE_EXEC,
|
||||
ProcessStats.STATE_NOTHING, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user