mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Improve debug logging for reconciliation.
This commit is contained in:
committed by
Cody Henthorne
parent
c19017f037
commit
9021883baa
@@ -11,7 +11,6 @@ import org.signal.donations.InAppPaymentType
|
||||
import org.thoughtcrime.securesms.backup.v2.ArchiveRestoreProgress
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.DonationSerializationHelper.toFiatMoney
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppPaymentsRepository
|
||||
import org.thoughtcrime.securesms.database.AttachmentTable
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.model.InAppPaymentSubscriberRecord
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
@@ -94,42 +93,12 @@ class LogSectionRemoteBackups : LogSection {
|
||||
}
|
||||
|
||||
output.append("\n -- Attachment Stats\n")
|
||||
output.append(SignalDatabase.attachments.debugGetAttachmentStats().toPrettyString())
|
||||
output.append(SignalDatabase.attachments.debugGetAttachmentStats().prettyString())
|
||||
|
||||
return output
|
||||
}
|
||||
}
|
||||
|
||||
private fun AttachmentTable.DebugAttachmentStats.toPrettyString(): String {
|
||||
return buildString {
|
||||
appendLine("Total attachment rows: $totalAttachmentRows")
|
||||
appendLine("Total eligible for upload rows: $totalEligibleForUploadRows")
|
||||
appendLine("Total unique media names eligible for upload: $totalUniqueMediaNamesEligibleForUpload")
|
||||
appendLine("Total unique data files: $totalUniqueDataFiles")
|
||||
appendLine("Total unique media names: $totalUniqueMediaNames")
|
||||
appendLine("Media names with thumbnails count: $mediaNamesWithThumbnailsCount")
|
||||
appendLine("Pending attachment upload bytes: $pendingAttachmentUploadBytes")
|
||||
appendLine("Uploaded attachment bytes: $uploadedAttachmentBytes")
|
||||
appendLine("Uploaded thumbnail bytes: $uploadedThumbnailBytes")
|
||||
appendLine("Total upload count: $totalUploadCount")
|
||||
appendLine("Total upload bytes: $totalUploadBytes")
|
||||
|
||||
if (archiveStatusMediaNameCounts.isNotEmpty()) {
|
||||
appendLine("Archive status media name counts:")
|
||||
archiveStatusMediaNameCounts.forEach { (state, count) ->
|
||||
appendLine(" ${state.name}: $count")
|
||||
}
|
||||
}
|
||||
|
||||
if (archiveStatusMediaNameThumbnailCounts.isNotEmpty()) {
|
||||
appendLine("Archive status media name thumbnail counts:")
|
||||
archiveStatusMediaNameThumbnailCounts.forEach { (state, count) ->
|
||||
appendLine(" ${state.name}: $count")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun ArchiveUploadProgressState.toPrettyString(): String {
|
||||
return buildString {
|
||||
appendLine("state: ${state.name}")
|
||||
|
||||
Reference in New Issue
Block a user