Debug: added rule counts for account/folder

pull/214/head
M66B 1 year ago
parent 38f37068bf
commit fca97123e3

@ -67,8 +67,12 @@ public interface DaoRule {
" ORDER by `group` COLLATE NOCASE") " ORDER by `group` COLLATE NOCASE")
List<String> getGroups(); List<String> getGroups();
@Query("SELECT COUNT(*) FROM rule") @Query("SELECT COUNT(*) FROM rule" +
int countTotal(); " JOIN folder ON folder.id = rule.folder" +
" WHERE (:account IS NULL OR folder.account = :account)" +
" AND (:folder IS NULL OR folder.id = :folder)" +
" AND rule.enabled")
int countTotal(Long account, Long folder);
@Insert @Insert
long insertRule(EntityRule rule); long insertRule(EntityRule rule);

@ -728,7 +728,7 @@ public class DebugHelper {
"accounts=" + accounts.size() + "accounts=" + accounts.size() +
" folders=" + db.folder().countSync() + "/" + db.folder().countTotal() + " folders=" + db.folder().countSync() + "/" + db.folder().countTotal() +
" messages=" + db.message().countTotal() + " messages=" + db.message().countTotal() +
" rules=" + db.rule().countTotal() + " rules=" + db.rule().countTotal(null, null) +
" ops=" + db.operation().getOperationCount() + " ops=" + db.operation().getOperationCount() +
" outbox=" + db.message().countOutbox() + "\r\n" + " outbox=" + db.message().countOutbox() + "\r\n" +
"filter " + filters + " " + sorts + "filter " + filters + " " + sorts +
@ -830,6 +830,7 @@ public class DebugHelper {
" ondemand=" + account.ondemand + (account.ondemand ? " !!!" : "") + " ondemand=" + account.ondemand + (account.ondemand ? " !!!" : "") +
" msgs=" + content + "/" + messages + " max=" + account.max_messages + " msgs=" + content + "/" + messages + " max=" + account.max_messages +
" blocked=" + blocked + (blocked == 0 ? "" : " !!!") + " blocked=" + blocked + (blocked == 0 ? "" : " !!!") +
" rules=" + db.rule().countTotal(account.id, null) +
" ops=" + db.operation().getOperationCount(account.id) + " ops=" + db.operation().getOperationCount(account.id) +
" schedule=" + (!ignore_schedule) + (ignore_schedule ? " !!!" : "") + " schedule=" + (!ignore_schedule) + (ignore_schedule ? " !!!" : "") +
" unmetered=" + unmetered + (unmetered ? " !!!" : "") + " unmetered=" + unmetered + (unmetered ? " !!!" : "") +
@ -856,6 +857,7 @@ public class DebugHelper {
" factor=" + folder.poll_factor + " factor=" + folder.poll_factor +
" days=" + getDays(folder.sync_days) + "/" + getDays(folder.keep_days) + " days=" + getDays(folder.sync_days) + "/" + getDays(folder.keep_days) +
" msgs=" + folder.content + "/" + folder.messages + "/" + folder.total + " msgs=" + folder.content + "/" + folder.messages + "/" + folder.total +
" rules=" + db.rule().countTotal(account.id, folder.id) +
" ops=" + db.operation().getOperationCount(folder.id, null) + " ops=" + db.operation().getOperationCount(folder.id, null) +
" unseen=" + unseen + " hidden=" + hidden + " notifying=" + notifying + " unseen=" + unseen + " hidden=" + hidden + " notifying=" + notifying +
" " + folder.state + " " + folder.state +

Loading…
Cancel
Save