X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fbenchmark.ts;h=011519fe38d11ea3d173d0b0a87690df39e930a0;hb=1e9c1b1b44b4cbd4bc4b1e97e8e6ba2df93371de;hp=83b9329090cd0adf9a167903168cc13ec523703f;hpb=a24bd1ed41b43790bab6ba789580bb4e85f07d85;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 83b932909..011519fe3 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -1,11 +1,11 @@ -import * as autocannon from 'autocannon' -import { writeJson } from 'fs-extra' -import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' -import { Video, VideoPrivacy } from '@shared/models' import { registerTSPaths } from '../server/helpers/register-ts-paths' - registerTSPaths() +import autocannon, { printResult } from 'autocannon' +import { writeJson } from 'fs-extra' +import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' +import { Video, VideoPrivacy } from '@shared/models' + let server: PeerTubeServer let video: Video let threadId: number @@ -135,7 +135,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 +149,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)