Add additional timing logs for getting resumable upload spec.

fork-5.53.8
Cody Henthorne 2022-02-02 13:53:06 -05:00
rodzic cf0d54d04f
commit d690a52fd7
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -603,6 +603,7 @@ public class SignalServiceMessageSender {
} }
public ResumableUploadSpec getResumableUploadSpec() throws IOException { public ResumableUploadSpec getResumableUploadSpec() throws IOException {
long start = System.currentTimeMillis();
AttachmentV3UploadAttributes v3UploadAttributes = null; AttachmentV3UploadAttributes v3UploadAttributes = null;
Log.d(TAG, "Using pipe to retrieve attachment upload attributes..."); Log.d(TAG, "Using pipe to retrieve attachment upload attributes...");
@ -614,12 +615,20 @@ public class SignalServiceMessageSender {
Log.w(TAG, "Failed to retrieve attachment upload attributes using pipe. Falling back..."); Log.w(TAG, "Failed to retrieve attachment upload attributes using pipe. Falling back...");
} }
long webSocket = System.currentTimeMillis() - start;
if (v3UploadAttributes == null) { if (v3UploadAttributes == null) {
Log.d(TAG, "Not using pipe to retrieve attachment upload attributes..."); Log.d(TAG, "Not using pipe to retrieve attachment upload attributes...");
v3UploadAttributes = socket.getAttachmentV3UploadAttributes(); v3UploadAttributes = socket.getAttachmentV3UploadAttributes();
} }
return socket.getResumableUploadSpec(v3UploadAttributes); long rest = System.currentTimeMillis() - start;
ResumableUploadSpec spec = socket.getResumableUploadSpec(v3UploadAttributes);
long end = System.currentTimeMillis() - start;
Log.d(TAG, "[getResumableUploadSpec] webSocket: " + webSocket + " rest: " + rest + " end: " + end);
return spec;
} }
private SignalServiceAttachmentPointer uploadAttachmentV3(SignalServiceAttachmentStream attachment, byte[] attachmentKey, PushAttachmentData attachmentData) throws IOException { private SignalServiceAttachmentPointer uploadAttachmentV3(SignalServiceAttachmentStream attachment, byte[] attachmentKey, PushAttachmentData attachmentData) throws IOException {