diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 7eaa1963a6..d17300cb8e 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -521,6 +521,7 @@ public class Log { event.addMetadata("extra", "memory_available", getAvailableMb()); event.addMetadata("extra", "native_allocated", Debug.getNativeHeapAllocatedSize() / 1024L / 1024L); event.addMetadata("extra", "native_size", Debug.getNativeHeapSize() / 1024L / 1024L); + event.addMetadata("extra", "classifier_size", MessageClassifier.getSize(context)); Boolean ignoringOptimizations = Helper.isIgnoringOptimizations(context); event.addMetadata("extra", "optimizing", (ignoringOptimizations != null && !ignoringOptimizations)); diff --git a/app/src/main/java/eu/faircode/email/MessageClassifier.java b/app/src/main/java/eu/faircode/email/MessageClassifier.java index 2ecdc2ce07..305b8ba203 100644 --- a/app/src/main/java/eu/faircode/email/MessageClassifier.java +++ b/app/src/main/java/eu/faircode/email/MessageClassifier.java @@ -758,6 +758,11 @@ public class MessageClassifier { backup ? "classifier.backup" : "classifier.json"); } + static long getSize(Context context) { + File file = getFile(context, false); + return (file.exists() ? file.length() : -1L); + } + private static class State { private final List words = new ArrayList<>(); private final Map classStats = new HashMap<>();