mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Ignore message latency when latency is before device boot time.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -213,6 +215,11 @@ public final class SignalLocalMetrics {
|
||||
String name = highPriority ? NAME_HIGH : NAME_LOW;
|
||||
long latency = serverDeliverTimestamp - serverReceiveTimestamp;
|
||||
|
||||
if (latency > SystemClock.elapsedRealtime()) {
|
||||
// Ignore messages with latency that would be before device boot time
|
||||
return;
|
||||
}
|
||||
|
||||
String id = name + System.currentTimeMillis();
|
||||
LocalMetrics.getInstance().start(id, name);
|
||||
LocalMetrics.getInstance().splitWithDuration(id, SPLIT_LATENCY, latency);
|
||||
|
||||
Reference in New Issue
Block a user