Add performance metrics for archive uploads.

This commit is contained in:
Greyson Parrelli
2025-08-14 13:33:23 -04:00
committed by Jeffrey Starke
parent 9ccdbb8e40
commit 73ad6221a6
5 changed files with 84 additions and 9 deletions

View File

@@ -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);
}
}
}