mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-20 04:53:50 +02: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 assetCacheRead = async function(assetKey, updateReadTime = false) {
|
||||||
|
const t0 = Date.now();
|
||||||
const internalKey = `cache/${assetKey}`;
|
const internalKey = `cache/${assetKey}`;
|
||||||
|
|
||||||
const reportBack = function(content) {
|
const reportBack = function(content) {
|
||||||
|
@ -551,6 +552,12 @@ const assetCacheRead = async function(assetKey, updateReadTime = false) {
|
||||||
getAssetCacheRegistry(),
|
getAssetCacheRegistry(),
|
||||||
cacheStorage.get(internalKey),
|
cacheStorage.get(internalKey),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
µb.supportStats.maxAssetCacheWait = Math.max(
|
||||||
|
Date.now() - t0,
|
||||||
|
parseInt(µb.supportStats.maxAssetCacheWait, 10)
|
||||||
|
) + ' ms';
|
||||||
|
|
||||||
if (
|
if (
|
||||||
bin instanceof Object === false ||
|
bin instanceof Object === false ||
|
||||||
bin.hasOwnProperty(internalKey) === false
|
bin.hasOwnProperty(internalKey) === false
|
||||||
|
|
|
@ -215,6 +215,7 @@ const µBlock = { // jshint ignore:line
|
||||||
|
|
||||||
supportStats: {
|
supportStats: {
|
||||||
allReadyAfter: '',
|
allReadyAfter: '',
|
||||||
|
maxAssetCacheWait: '0 ms',
|
||||||
},
|
},
|
||||||
|
|
||||||
pageStores: new Map(),
|
pageStores: new Map(),
|
||||||
|
|
Loading…
Reference in a new issue