Log total time for conversation to render.
This commit is contained in:
parent
992b04f8c5
commit
e4b3f90457
1 changed files with 15 additions and 0 deletions
|
@ -137,6 +137,7 @@ import org.thoughtcrime.securesms.util.SetUtil;
|
||||||
import org.thoughtcrime.securesms.util.SignalProxyUtil;
|
import org.thoughtcrime.securesms.util.SignalProxyUtil;
|
||||||
import org.thoughtcrime.securesms.util.SnapToTopDataObserver;
|
import org.thoughtcrime.securesms.util.SnapToTopDataObserver;
|
||||||
import org.thoughtcrime.securesms.util.StickyHeaderDecoration;
|
import org.thoughtcrime.securesms.util.StickyHeaderDecoration;
|
||||||
|
import org.thoughtcrime.securesms.util.Stopwatch;
|
||||||
import org.thoughtcrime.securesms.util.StorageUtil;
|
import org.thoughtcrime.securesms.util.StorageUtil;
|
||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||||
|
@ -200,6 +201,7 @@ public class ConversationFragment extends LoggingFragment {
|
||||||
private int pulsePosition = -1;
|
private int pulsePosition = -1;
|
||||||
private VoiceNoteMediaController voiceNoteMediaController;
|
private VoiceNoteMediaController voiceNoteMediaController;
|
||||||
private View toolbarShadow;
|
private View toolbarShadow;
|
||||||
|
private Stopwatch startupStopwatch;
|
||||||
|
|
||||||
public static void prepare(@NonNull Context context) {
|
public static void prepare(@NonNull Context context) {
|
||||||
FrameLayout parent = new FrameLayout(context);
|
FrameLayout parent = new FrameLayout(context);
|
||||||
|
@ -217,6 +219,7 @@ public class ConversationFragment extends LoggingFragment {
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
this.locale = (Locale) getArguments().getSerializable(PassphraseRequiredActivity.LOCALE_EXTRA);
|
this.locale = (Locale) getArguments().getSerializable(PassphraseRequiredActivity.LOCALE_EXTRA);
|
||||||
|
startupStopwatch = new Stopwatch("conversation-open");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -564,6 +567,18 @@ public class ConversationFragment extends LoggingFragment {
|
||||||
setLastSeen(conversationViewModel.getLastSeen());
|
setLastSeen(conversationViewModel.getLastSeen());
|
||||||
|
|
||||||
emptyConversationBanner.setVisibility(View.GONE);
|
emptyConversationBanner.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
||||||
|
@Override
|
||||||
|
public void onItemRangeInserted(int positionStart, int itemCount) {
|
||||||
|
startupStopwatch.split("data-set");
|
||||||
|
adapter.unregisterAdapterDataObserver(this);
|
||||||
|
list.post(() -> {
|
||||||
|
startupStopwatch.split("first-render");
|
||||||
|
startupStopwatch.stop(TAG);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (threadId == -1) {
|
} else if (threadId == -1) {
|
||||||
emptyConversationBanner.setVisibility(View.VISIBLE);
|
emptyConversationBanner.setVisibility(View.VISIBLE);
|
||||||
toolbarShadow.setVisibility(View.GONE);
|
toolbarShadow.setVisibility(View.GONE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue