Debug: added rule counts for account/folder

This commit is contained in:
M66B 2023-12-17 14:23:28 +01:00
parent 38f37068bf
commit fca97123e3
2 changed files with 9 additions and 3 deletions

View File

@ -67,8 +67,12 @@ public interface DaoRule {
" ORDER by `group` COLLATE NOCASE")
List<String> getGroups();
@Query("SELECT COUNT(*) FROM rule")
int countTotal();
@Query("SELECT COUNT(*) FROM rule" +
" 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
long insertRule(EntityRule rule);

View File

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