mw.inspect: add report for mw.loader.store
authorOri Livneh <ori@wikimedia.org>
Thu, 31 Oct 2013 16:26:40 +0000 (09:26 -0700)
committerOri Livneh <ori@wikimedia.org>
Sun, 3 Nov 2013 17:39:11 +0000 (09:39 -0800)
commitfbfca0d10f3cc5ad57c16f304bf8b3e6b3396db5
tree9a1511fcd206505248fd9718a8e8071d185a9bcf
parent63b41a21b9f98610e7800face05e3aa6f4d2f7cc
mw.inspect: add report for mw.loader.store

Adds a 'store' report to mw.inspect, which outputs:
* Whether localStorage module caching is enabled.
* Cache hit / miss counts.
* Number of items purged from the cache.
* Total size of the cache blob in localStorage.

Rather than duplicate the logic that converted a numeric byte count to a
human-readable format, I moved it to new helper function: humanSize.

Change-Id: I5b98322ba843f32e6a99829b4cf3d8fb0bc61514
resources/mediawiki/mediawiki.inspect.js