app: print 50 routes and ips in debug

This commit is contained in:
DIYgod
2018-10-08 01:12:11 +08:00
parent e7da789fe8
commit 57927d5988

View File

@@ -18,14 +18,14 @@ router.get('/', async (ctx) => {
});
const routes = Object.keys(ctx.debug.routes).sort((a, b) => ctx.debug.routes[b] - ctx.debug.routes[a]);
const hotRoutes = routes.slice(0, 10);
const hotRoutes = routes.slice(0, 50);
let hotRoutesValue = '';
hotRoutes.forEach((item) => {
hotRoutesValue += `${ctx.debug.routes[item]}&nbsp;&nbsp;${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, 10);
const hotIPs = ips.slice(0, 50);
let hotIPsValue = '';
hotIPs.forEach((item) => {
hotIPsValue += `${ctx.debug.ips[item]}&nbsp;&nbsp;${item}<br>`;