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

Commit 4d427987 authored by Sanath Kumar's avatar Sanath Kumar
Browse files

Track periodic and flex intervals in ScheduledJobStateChanged events

Added logging of periodic and flex intervals for
ScheduledJobStateChanged events. This data will help analyze app
usage of periodic job APIs and identify potential optimization
opportunities for performance and power.

Bug: 296629905
Test: Ran "statsd_testdrive 8". New fields added to the
ScheduledJobStateChanged are retrieved shown without any errors.

Change-Id: Ib41ea3edfb9d22772206f16975ce3a2d287cbbfd
parent 99b3bb76
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1828,7 +1828,9 @@ public class JobSchedulerService extends com.android.server.SystemService
                    /* system_measured_source_download_bytes */0,
                    /* system_measured_source_upload_bytes */ 0,
                    /* system_measured_calling_download_bytes */0,
                    /* system_measured_calling_upload_bytes */ 0);
                    /* system_measured_calling_upload_bytes */ 0,
                    jobStatus.getJob().getIntervalMillis(),
                    jobStatus.getJob().getFlexMillis());

            // If the job is immediately ready to run, then we can just immediately
            // put it in the pending list and try to schedule it.  This is especially
@@ -2269,7 +2271,9 @@ public class JobSchedulerService extends com.android.server.SystemService
                    /* system_measured_source_download_bytes */ 0,
                    /* system_measured_source_upload_bytes */ 0,
                    /* system_measured_calling_download_bytes */0,
                    /* system_measured_calling_upload_bytes */ 0);
                    /* system_measured_calling_upload_bytes */ 0,
                    cancelled.getJob().getIntervalMillis(),
                    cancelled.getJob().getFlexMillis());
        }
        // If this is a replacement, bring in the new version of the job
        if (incomingJob != null) {
+6 −2
Original line number Diff line number Diff line
@@ -534,7 +534,9 @@ public final class JobServiceContext implements ServiceConnection {
                    /* system_measured_source_download_bytes */ 0,
                    /* system_measured_source_upload_bytes */ 0,
                    /* system_measured_calling_download_bytes */ 0,
                    /* system_measured_calling_upload_bytes */ 0);
                    /* system_measured_calling_upload_bytes */ 0,
                    job.getJob().getIntervalMillis(),
                    job.getJob().getFlexMillis());
            sEnqueuedJwiAtJobStart.logSampleWithUid(job.getUid(), job.getWorkCount());
            final String sourcePackage = job.getSourcePackageName();
            if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) {
@@ -1616,7 +1618,9 @@ public final class JobServiceContext implements ServiceConnection {
                TrafficStats.getUidRxBytes(completedJob.getUid())
                        - mInitialDownloadedBytesFromCalling,
                TrafficStats.getUidTxBytes(completedJob.getUid())
                        - mInitialUploadedBytesFromCalling);
                        - mInitialUploadedBytesFromCalling,
                completedJob.getJob().getIntervalMillis(),
                completedJob.getJob().getFlexMillis());
        if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) {
            Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_SYSTEM_SERVER, "JobScheduler",
                    getId());