diff --git a/lib/routes/index.js b/lib/routes/index.js index 8fe908062f..847d2d06fb 100644 --- a/lib/routes/index.js +++ b/lib/routes/index.js @@ -71,7 +71,7 @@ module.exports = async (ctx) => { debug: [ config.nodeName ? { - name: '节点名', + name: 'node name', value: config.nodeName, } : null, @@ -80,47 +80,47 @@ module.exports = async (ctx) => { value: gitHash, }, { - name: '请求数', + name: 'request amount', value: ctx.debug.request, }, { - name: '请求频率', + name: 'request frequency', value: ((ctx.debug.request / (stats.elapsed / 1000)) * 60).toFixed(3) + ' 次/分钟', }, { - name: '缓存命中率', + name: 'cache hit ratio', value: ctx.debug.request ? (ctx.debug.hitCache / ctx.debug.request).toFixed(3) : 0, }, { - name: '内存占用', + name: 'memory usage', value: stats.memory / 1000000 + ' MB', }, { - name: 'CPU 占用', + name: 'CPU usage', value: stats.cpu + '%', }, { - name: '运行时间', + name: 'run time', value: (stats.elapsed / 3600000).toFixed(2) + ' 小时', }, { - name: '热门路由', + name: 'hot routes', value: hotRoutesValue, }, { - name: '热门路径', + name: 'hot paths', value: hotPathsValue, }, { - name: '热门IP', + name: 'hot IP', value: hotIPsValue, }, { - name: '报错路由', + name: 'hot error routes', value: hotErrorRoutesValue, }, { - name: '报错路径', + name: 'hot error paths', value: hotErrorPathsValue, }, ], diff --git a/test/middleware/debug.js b/test/middleware/debug.js index 9baa4ae5be..d6f50b12a3 100644 --- a/test/middleware/debug.js +++ b/test/middleware/debug.js @@ -38,28 +38,28 @@ describe('debug', () => { .html() .trim(); switch (key) { - case '节点名:': + case 'node name:': expect(value).toBe('mock'); break; case 'git hash:': expect(value).toBe(gitHash); break; - case '请求数:': + case 'request amount:': expect(value).toBe('6'); break; - case '热门路由:': + case 'hot routes:': expect(value).toBe(`7  /test/:id
`); break; - case '热门路径:': + case 'hot paths:': expect(value).toBe(`3  /test/1
2  /test/2
2  /test/empty
1  /
`); break; - case '热门IP:': + case 'hot IP:': expect(value).toBe(`5  233.233.233.233
3  233.233.233.234
`); break; - case '报错路由:': + case 'hot error routes:': expect(value).toBe(`2  /test/:id
`); break; - case '报错路径:': + case 'hot error paths:': expect(value).toBe(`2  /test/empty
`); break; }