]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/benchmark.ts
Translated using Weblate (Ukrainian)
[github/Chocobozzz/PeerTube.git] / scripts / benchmark.ts
index 071c4dea7c639042fac715e83c085123f1efa2ec..c29b9abcdb6c9e20f4eb841dbd9234032ae419cb 100644 (file)
@@ -1,10 +1,10 @@
-import * as autocannon from 'autocannon'
+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/extra-utils'
 import { Video, VideoPrivacy } from '@shared/models'
-import { registerTSPaths } from '../server/helpers/register-ts-paths'
-
-registerTSPaths()
 
 let server: PeerTubeServer
 let video: Video
@@ -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)
@@ -232,7 +232,7 @@ async function prepare () {
   }
 
   for (const caption of [ 'ar', 'fr', 'en', 'zh' ]) {
-    await server.captions.createVideoCaption({
+    await server.captions.add({
       language: caption,
       videoId: video.id,
       fixture: 'subtitle-good2.vtt'