diff options
author | shubang <shubang@google.com> | 2018-10-11 18:25:28 -0700 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2018-10-12 16:20:25 -0700 |
commit | 4f19c9b681c705d40133f4a58987a9a07015c86c (patch) | |
tree | 139d462419a85799b9e76ba3c9c3f42df1f354fb /src/com/android/tv/guide/ProgramGuide.java | |
parent | e3c5f1dcef4a5023c141afd20adedc09e33412ef (diff) | |
download | TV-4f19c9b681c705d40133f4a58987a9a07015c86c.tar.gz |
Measure the amount of time to show the EPG
1. When EPG has been pre-fetched: layout time
2. When hasn't: pre-fetch time
PiperOrigin-RevId: 216795157
Change-Id: I6a6a5c156fb983345d2afff0b04704323ad41e6c
Diffstat (limited to 'src/com/android/tv/guide/ProgramGuide.java')
-rw-r--r-- | src/com/android/tv/guide/ProgramGuide.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/tv/guide/ProgramGuide.java b/src/com/android/tv/guide/ProgramGuide.java index 9b90c1fa..03b47d38 100644 --- a/src/com/android/tv/guide/ProgramGuide.java +++ b/src/com/android/tv/guide/ProgramGuide.java @@ -48,6 +48,7 @@ import com.android.tv.ChannelTuner; import com.android.tv.MainActivity; import com.android.tv.R; import com.android.tv.TvFeatures; +import com.android.tv.TvSingletons; import com.android.tv.analytics.Tracker; import com.android.tv.common.WeakHandler; import com.android.tv.common.util.DurationTimer; @@ -56,6 +57,9 @@ import com.android.tv.data.GenreItems; import com.android.tv.data.ProgramDataManager; import com.android.tv.dvr.DvrDataManager; import com.android.tv.dvr.DvrScheduleManager; +import com.android.tv.perf.EventNames; +import com.android.tv.perf.PerformanceMonitor; +import com.android.tv.perf.TimerEvent; import com.android.tv.ui.HardwareLayerAnimatorListenerAdapter; import com.android.tv.ui.ViewUtils; import com.android.tv.ui.hideable.AutoHideScheduler; @@ -150,6 +154,9 @@ public class ProgramGuide private final ProgramManagerListener mProgramManagerListener = new ProgramManagerListener(); + private final PerformanceMonitor mPerformanceMonitor; + private TimerEvent mTimerEvent; + private final Runnable mUpdateTimeIndicator = new Runnable() { @Override @@ -175,6 +182,7 @@ public class ProgramGuide Runnable preShowRunnable, Runnable postHideRunnable) { mActivity = activity; + mPerformanceMonitor = TvSingletons.getSingletons(mActivity).getPerformanceMonitor(); mProgramManager = new ProgramManager( tvInputManagerHelper, @@ -447,6 +455,7 @@ public class ProgramGuide if (mContainer.getVisibility() == View.VISIBLE) { return; } + mTimerEvent = mPerformanceMonitor.startTimer(); mTracker.sendShowEpg(); mTracker.sendScreenView(SCREEN_NAME); if (mPreShowRunnable != null) { @@ -522,6 +531,11 @@ public class ProgramGuide } else { mShowAnimatorFull.start(); } + if (mTimerEvent != null) { + mPerformanceMonitor + .stopTimer(mTimerEvent, EventNames.PROGRAM_GUIDE_SHOW); + mTimerEvent = null; + } } }; mContainer.getViewTreeObserver().addOnGlobalLayoutListener(mOnLayoutListenerForShow); |