Added statistics to debug info

pull/194/merge
M66B 3 years ago
parent 9564ed0e9b
commit fa8e8ee011

@ -231,6 +231,9 @@ public interface DaoFolder {
@Query("SELECT download FROM folder WHERE id = :id")
boolean getFolderDownload(long id);
@Query("SELECT COUNT(*) FROM folder")
int countTotal();
@Insert
long insertFolder(EntityFolder folder);

@ -464,6 +464,9 @@ public interface DaoMessage {
" AND sender = :sender")
int countSender(long folder, String sender);
@Query("SELECT COUNT(*) FROM message")
int countTotal();
@Query("SELECT message.*" +
", account.pop AS accountProtocol, account.name AS accountName, account.category AS accountCategory, identity.color AS accountColor" +
", account.notify AS accountNotify, account.leave_deleted AS accountLeaveDeleted, account.auto_seen AS accountAutoSeen" +

@ -53,6 +53,9 @@ public interface DaoRule {
" ORDER BY `order`, name COLLATE NOCASE")
LiveData<List<TupleRuleEx>> liveRules(long folder);
@Query("SELECT COUNT(*) FROM rule")
int countTotal();
@Insert
long insertRule(EntityRule rule);

@ -2067,14 +2067,17 @@ public class Log {
boolean auto_optimize = prefs.getBoolean("auto_optimize", false);
boolean schedule = prefs.getBoolean("schedule", false);
size += write(os, "accounts=" + accounts.size() +
" enabled=" + enabled +
size += write(os, "enabled=" + enabled +
" interval=" + pollInterval + "\r\n" +
" metered=" + metered +
"metered=" + metered +
" VPN=" + ConnectionHelper.vpnActive(context) +
" NetGuard=" + Helper.isInstalled(context, "eu.faircode.netguard") + "\r\n" +
" optimizing=" + (ignoring == null ? null : !ignoring) +
" auto_optimize=" + auto_optimize +
"optimizing=" + (ignoring == null ? null : !ignoring) +
" auto_optimize=" + auto_optimize + "\r\n" +
"accounts=" + accounts.size() +
" folders=" + db.folder().countTotal() +
" messages=" + db.message().countTotal() +
" rules=" + db.rule().countTotal() +
"\r\n\r\n");
if (schedule) {

Loading…
Cancel
Save