Add debug logging for attachment restore speeds.

This commit is contained in:
Greyson Parrelli
2025-08-15 16:05:53 -04:00
committed by Jeffrey Starke
parent eb4abf2a9e
commit d636ef8ec9
6 changed files with 133 additions and 13 deletions

View File

@@ -516,4 +516,21 @@ public final class SignalLocalMetrics {
LocalMetrics.getInstance().end(NAME + id);
}
}
/**
* Tracks how long it took to restore an attachment.
*/
public static final class ArchiveAttachmentRestore {
private static final String NAME = "archive-attachment-restore";
/** 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);
}
}
}