mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 06:30:40 +08:00
feat: add error routes and error paths info
This commit is contained in:
@@ -29,6 +29,24 @@ module.exports = async (ctx) => {
|
||||
hotPathsValue += `${ctx.debug.paths[item]} ${item}<br>`;
|
||||
});
|
||||
|
||||
let hotErrorRoutesValue = '';
|
||||
if (ctx.debug.errorRoutes) {
|
||||
const errorRoutes = Object.keys(ctx.debug.errorRoutes).sort((a, b) => ctx.debug.errorRoutes[b] - ctx.debug.errorRoutes[a]);
|
||||
const hotErrorRoutes = errorRoutes.slice(0, 30);
|
||||
hotErrorRoutes.forEach((item) => {
|
||||
hotErrorRoutesValue += `${ctx.debug.errorRoutes[item]} ${item}<br>`;
|
||||
});
|
||||
}
|
||||
|
||||
let hotErrorPathsValue = '';
|
||||
if (ctx.debug.errorPaths) {
|
||||
const errorPaths = Object.keys(ctx.debug.errorPaths).sort((a, b) => ctx.debug.errorPaths[b] - ctx.debug.errorPaths[a]);
|
||||
const hotErrorPaths = errorPaths.slice(0, 30);
|
||||
hotErrorPaths.forEach((item) => {
|
||||
hotErrorPathsValue += `${ctx.debug.errorPaths[item]} ${item}<br>`;
|
||||
});
|
||||
}
|
||||
|
||||
const ips = Object.keys(ctx.debug.ips).sort((a, b) => ctx.debug.ips[b] - ctx.debug.ips[a]);
|
||||
const hotIPs = ips.slice(0, 50);
|
||||
let hotIPsValue = '';
|
||||
@@ -97,6 +115,14 @@ module.exports = async (ctx) => {
|
||||
name: '热门IP',
|
||||
value: hotIPsValue,
|
||||
},
|
||||
{
|
||||
name: '报错路由',
|
||||
value: hotErrorRoutesValue,
|
||||
},
|
||||
{
|
||||
name: '报错路径',
|
||||
value: hotErrorPathsValue,
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user