Fix benchmark script

This commit is contained in:
Chocobozzz 2021-08-30 14:22:33 +02:00
parent 2b36e477bf
commit 736c64ca4b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE

View File

@ -1,7 +1,7 @@
import { registerTSPaths } from '../server/helpers/register-ts-paths' import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths() registerTSPaths()
import * as autocannon from 'autocannon' import autocannon, { printResult } from 'autocannon'
import { writeJson } from 'fs-extra' import { writeJson } from 'fs-extra'
import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
import { Video, VideoPrivacy } from '@shared/models' import { Video, VideoPrivacy } from '@shared/models'
@ -149,7 +149,7 @@ async function run () {
Object.assign(testResult, { title: test.title, path: test.path }) Object.assign(testResult, { title: test.title, path: test.path })
finalResult.push(testResult) finalResult.push(testResult)
console.log(autocannon.printResult(testResult)) console.log(printResult(testResult))
} }
if (outfile) await writeJson(outfile, finalResult) if (outfile) await writeJson(outfile, finalResult)