Locally track conversation open time.
This commit is contained in:
parent
555e65d3ee
commit
49190125ef
2 changed files with 27 additions and 0 deletions
|
@ -149,6 +149,7 @@ import org.thoughtcrime.securesms.util.HtmlUtil;
|
|||
import org.thoughtcrime.securesms.util.RemoteDeleteUtil;
|
||||
import org.thoughtcrime.securesms.util.SaveAttachmentTask;
|
||||
import org.thoughtcrime.securesms.util.SetUtil;
|
||||
import org.thoughtcrime.securesms.util.SignalLocalMetrics;
|
||||
import org.thoughtcrime.securesms.util.SignalProxyUtil;
|
||||
import org.thoughtcrime.securesms.util.SnapToTopDataObserver;
|
||||
import org.thoughtcrime.securesms.util.StickyHeaderDecoration;
|
||||
|
@ -240,6 +241,7 @@ public class ConversationFragment extends LoggingFragment {
|
|||
super.onCreate(icicle);
|
||||
this.locale = (Locale) getArguments().getSerializable(PassphraseRequiredActivity.LOCALE_EXTRA);
|
||||
startupStopwatch = new Stopwatch("conversation-open");
|
||||
SignalLocalMetrics.ConversationOpen.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -681,10 +683,12 @@ public class ConversationFragment extends LoggingFragment {
|
|||
@Override
|
||||
public void onItemRangeInserted(int positionStart, int itemCount) {
|
||||
startupStopwatch.split("data-set");
|
||||
SignalLocalMetrics.ConversationOpen.onDataLoaded();
|
||||
adapter.unregisterAdapterDataObserver(this);
|
||||
list.post(() -> {
|
||||
startupStopwatch.split("first-render");
|
||||
startupStopwatch.stop(TAG);
|
||||
SignalLocalMetrics.ConversationOpen.onRenderFinished();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -103,6 +103,29 @@ public final class SignalLocalMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
public static final class ConversationOpen {
|
||||
private static final String NAME = "conversation-open";
|
||||
|
||||
private static final String SPLIT_DATA_LOADED = "data-loaded";
|
||||
private static final String SPLIT_RENDER = "render";
|
||||
|
||||
private static String id;
|
||||
|
||||
public static void start() {
|
||||
id = NAME + "-" + System.currentTimeMillis();
|
||||
LocalMetrics.getInstance().start(id, NAME);
|
||||
}
|
||||
|
||||
public static void onDataLoaded() {
|
||||
LocalMetrics.getInstance().split(id, SPLIT_DATA_LOADED);
|
||||
}
|
||||
|
||||
public static void onRenderFinished() {
|
||||
LocalMetrics.getInstance().split(id, SPLIT_RENDER);
|
||||
LocalMetrics.getInstance().end(id);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class GroupMessageSend {
|
||||
private static final String NAME = "group-message-send";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue