diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-09 13:47:28 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-09 13:47:28 +0900 |
| commit | 51ba738c4b3c8769ffb896d921f48793c72c5c5e (patch) | |
| tree | c75bb8198f9fe04f19f4073bad746d8d545448d1 /src/server | |
| parent | Fix i18n (diff) | |
| parent | Add group function (#3175) (diff) | |
| download | misskey-51ba738c4b3c8769ffb896d921f48793c72c5c5e.tar.gz misskey-51ba738c4b3c8769ffb896d921f48793c72c5c5e.tar.bz2 misskey-51ba738c4b3c8769ffb896d921f48793c72c5c5e.zip | |
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/index.ts b/src/server/index.ts index f1933dc405..77c869bb4e 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -19,6 +19,7 @@ import webFinger from './webfinger'; import config from '../config'; import networkChart from '../chart/network'; import apiServer from './api'; +import { sum } from '../prelude/array'; // Init app const app = new Koa(); @@ -99,9 +100,9 @@ export default () => new Promise(resolve => { if (queue.length == 0) return; const requests = queue.length; - const time = queue.reduce((a, b) => a + b.time, 0); - const incomingBytes = queue.reduce((a, b) => a + b.req.bytes, 0); - const outgoingBytes = queue.reduce((a, b) => a + b.res.bytes, 0); + const time = sum(queue.map(x => x.time)); + const incomingBytes = sum(queue.map(x => x.req.byets)); + const outgoingBytes = sum(queue.map(x => x.res.byets)); queue = []; networkChart.update(requests, time, incomingBytes, outgoingBytes); |