X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fbenchmark.ts;h=3c3c666a18e4a1cf77408257b5e21ff90eb456da;hb=7c8be859f77784eb34ff57de16a13ca9a925d554;hp=5dcf9b01b51472d37f04d2d47e003a19126c7fdc;hpb=9e8789497377cac5554a622da605f5b89587aa9c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 5dcf9b01b..3c3c666a1 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -1,10 +1,7 @@ -import { registerTSPaths } from '../server/helpers/register-ts-paths' -registerTSPaths() - -import * as autocannon from 'autocannon' +import autocannon, { printResult } from 'autocannon' import { writeJson } from 'fs-extra' -import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' import { Video, VideoPrivacy } from '@shared/models' +import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' let server: PeerTubeServer let video: Video @@ -135,7 +132,7 @@ async function run () { title: 'API - config', path: '/api/v1/config', expecter: (body, status) => { - return status === 200 && body.startsWith('{"instance":') + return status === 200 && body.startsWith('{"client":') } } ] @@ -149,7 +146,7 @@ async function run () { Object.assign(testResult, { title: test.title, path: test.path }) finalResult.push(testResult) - console.log(autocannon.printResult(testResult)) + console.log(printResult(testResult)) } if (outfile) await writeJson(outfile, finalResult)