mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
Add longest wait time when fetching from storage in support info
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1865 This may be useful to rule out that the issue is caused by the browser API responding in unduly delayed manner.
This commit is contained in:
parent
9759bfef4e
commit
de0f6a2cdd
2 changed files with 8 additions and 0 deletions
|
@ -538,6 +538,7 @@ const saveAssetCacheRegistry = (( ) => {
|
|||
})();
|
||||
|
||||
const assetCacheRead = async function(assetKey, updateReadTime = false) {
|
||||
const t0 = Date.now();
|
||||
const internalKey = `cache/${assetKey}`;
|
||||
|
||||
const reportBack = function(content) {
|
||||
|
@ -551,6 +552,12 @@ const assetCacheRead = async function(assetKey, updateReadTime = false) {
|
|||
getAssetCacheRegistry(),
|
||||
cacheStorage.get(internalKey),
|
||||
]);
|
||||
|
||||
µb.supportStats.maxAssetCacheWait = Math.max(
|
||||
Date.now() - t0,
|
||||
parseInt(µb.supportStats.maxAssetCacheWait, 10)
|
||||
) + ' ms';
|
||||
|
||||
if (
|
||||
bin instanceof Object === false ||
|
||||
bin.hasOwnProperty(internalKey) === false
|
||||
|
|
|
@ -215,6 +215,7 @@ const µBlock = { // jshint ignore:line
|
|||
|
||||
supportStats: {
|
||||
allReadyAfter: '',
|
||||
maxAssetCacheWait: '0 ms',
|
||||
},
|
||||
|
||||
pageStores: new Map(),
|
||||
|
|
Loading…
Reference in a new issue