Added quota logging

pull/214/head
M66B 10 months ago
parent f23add9d5a
commit 71a87804e3

@ -2894,7 +2894,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (quota.resources != null) if (quota.resources != null)
for (Quota.Resource resource : quota.resources) { for (Quota.Resource resource : quota.resources) {
EntityLog.log(context, EntityLog.Type.Account, account, EntityLog.log(context, EntityLog.Type.Account, account,
account.name + " Quota " + resource.name + " " + resource.usage + "/" + resource.limit); account.name + "quota " +
" root=\"" + quota.quotaRoot + "\"" +
" resource=\"" + resource.name + "\"" +
" " + resource.usage + "/" + resource.limit);
// (STORAGE nnnnn 9999999999999999) // (STORAGE nnnnn 9999999999999999)
if ("STORAGE".equalsIgnoreCase(resource.name)) { if ("STORAGE".equalsIgnoreCase(resource.name)) {
if (resource.usage * 1024 >= 0) if (resource.usage * 1024 >= 0)
@ -2903,6 +2906,12 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
limit = Math.max(limit == null ? 0L : limit, resource.limit * 1024); limit = Math.max(limit == null ? 0L : limit, resource.limit * 1024);
} }
} }
EntityLog.log(context, EntityLog.Type.Account,
account.name + " Quota" +
" records=" + quotas.length +
" usage=" + (usage == null ? null : Helper.humanReadableByteCount(usage)) +
" limit=" + (limit == null ? null : Helper.humanReadableByteCount(limit)) +
" " + (usage == null || limit == null ? "?" : 100 * usage / limit) + " %");
db.account().setAccountQuota(account.id, usage, limit); db.account().setAccountQuota(account.id, usage, limit);
} }
} else } else

Loading…
Cancel
Save