mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Add performance metrics for archive uploads.
This commit is contained in:
committed by
Jeffrey Starke
parent
9ccdbb8e40
commit
73ad6221a6
@@ -6,6 +6,8 @@ import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.thoughtcrime.securesms.attachments.AttachmentId;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -497,4 +499,21 @@ public final class SignalLocalMetrics {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks how long it took to upload an attachment to the archive CDN.
|
||||
*/
|
||||
public static final class ArchiveAttachmentUpload {
|
||||
private static final String NAME = "archive-attachment-upload";
|
||||
|
||||
/** When the attachment begins uploading. */
|
||||
public static void start(AttachmentId id) {
|
||||
LocalMetrics.getInstance().start(NAME, NAME + id);
|
||||
}
|
||||
|
||||
/** When the attachment finishes uploading. */
|
||||
public static void end(AttachmentId id) {
|
||||
LocalMetrics.getInstance().end(NAME + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user