diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js index 1747272d9a633febe1fea33c4bd1e69623c66055..21e49bfb594bd20e19782adc22d1984dcc2366d6 100644 --- a/lib/platform/github/gh-got-wrapper.js +++ b/lib/platform/github/gh-got-wrapper.js @@ -20,7 +20,9 @@ async function get(path, options, retries = 5) { return cache[path]; } logger.debug(`${method.toUpperCase()} ${path}`); - stats.requestCount = (stats.requestCount || 0) + 1; + stats.requests = (stats.requests || []).concat([ + method.toUpperCase() + ' ' + path.replace(opts.endpoint, ''), + ]); try { if (appMode) { const appAccept = 'application/vnd.github.machine-man-preview+json'; @@ -186,8 +188,17 @@ get.reset = function reset() { cache = null; cache = {}; // istanbul ignore if - if (stats.requestCount) { - logger.info({ stats }, 'Request stats'); + if (stats.requests && stats.requests.length) { + logger.info( + { + rateLimit: stats.rateLimit, + requestCount: stats.requests.length, + rateLimitRemaining: stats.rateLimitRemaining, + }, + 'Request stats' + ); + stats.requests.sort(); + logger.debug({ requests: stats.requests }, 'All requests'); } stats = {}; };