From 2ced30b5579916739546f61632bd773bd15632a7 Mon Sep 17 00:00:00 2001 From: Michelle Tang Date: Thu, 7 Aug 2025 12:40:56 -0400 Subject: [PATCH] Add notification profile size to local metrics. --- .../storage/InternalStorageServicePlaygroundFragment.kt | 4 +++- .../storage/InternalStorageServicePlaygroundViewModel.kt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundFragment.kt index c88730db52..d89292c662 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundFragment.kt @@ -262,6 +262,7 @@ private fun InsightsRow(insights: StorageInsights) { ManifestItemRow("Total Call Link Record Size", insights.totalCallLinkSize.toUnitString()) ManifestItemRow("Total Distribution List Record Size", insights.totalDistributionListSize.toUnitString()) ManifestItemRow("Total Chat Folder Record Size", insights.totalChatFolderSize.toUnitString()) + ManifestItemRow("Total Notification Profile Record Size", insights.totalNotificationProfileSize.toUnitString()) ManifestItemRow("Total Unknown Record Size", insights.totalUnknownSize.toUnitString()) Spacer(Modifier.height(16.dp)) @@ -273,7 +274,8 @@ private fun InsightsRow(insights: StorageInsights) { insights.totalAccountRecordSize, insights.totalCallLinkSize, insights.totalDistributionListSize, - insights.totalChatFolderSize + insights.totalChatFolderSize, + insights.totalNotificationProfileSize ).sumOf { it.bytes } != insights.totalRecordSize.bytes ) { Text("Mismatch! Sum of record sizes does not match our total record size!") diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundViewModel.kt index cc34711513..85c34fbf51 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/storage/InternalStorageServicePlaygroundViewModel.kt @@ -87,6 +87,7 @@ class InternalStorageServicePlaygroundViewModel : ViewModel() { totalCallLinkSize = records.filter { it.proto.callLink != null }.sumOf { it.sizeInBytes() }.bytes, totalDistributionListSize = records.filter { it.proto.storyDistributionList != null }.sumOf { it.sizeInBytes() }.bytes, totalChatFolderSize = records.filter { it.proto.chatFolder != null }.sumOf { it.sizeInBytes() }.bytes, + totalNotificationProfileSize = records.filter { it.proto.notificationProfile != null }.sumOf { it.sizeInBytes() }.bytes, totalUnknownSize = records.filter { it.isUnknown }.sumOf { it.sizeInBytes() }.bytes ) @@ -113,6 +114,7 @@ class InternalStorageServicePlaygroundViewModel : ViewModel() { val totalCallLinkSize: ByteSize = 0.bytes, val totalDistributionListSize: ByteSize = 0.bytes, val totalChatFolderSize: ByteSize = 0.bytes, + val totalNotificationProfileSize: ByteSize = 0.bytes, val totalUnknownSize: ByteSize = 0.bytes ) }