summary refs log tree commit diff
path: root/src/test/server_benchmark.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:09:35 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:09:35 +0200
commit08e837bf5559e9680fc8cb99bd05b93f8eb2cac5 (patch)
tree1eadc038773b025275d7b751265f741b09ca92ab /src/test/server_benchmark.ts
parentnpm i @fosscord/server-util@1.3.52 (diff)
downloadserver-08e837bf5559e9680fc8cb99bd05b93f8eb2cac5.tar.xz
:sparkles: api
Diffstat (limited to 'src/test/server_benchmark.ts')
-rw-r--r--src/test/server_benchmark.ts39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/test/server_benchmark.ts b/src/test/server_benchmark.ts
deleted file mode 100644

index c582ee89..00000000 --- a/src/test/server_benchmark.ts +++ /dev/null
@@ -1,39 +0,0 @@ -// @ts-nocheck -import "missing-native-js-functions"; -import { config } from "dotenv"; -config(); -import { DiscordServer } from "../Server"; -import fetch from "node-fetch"; -import { promises } from "fs"; -const count = 100; - -async function main() { - const server = new DiscordServer({ port: 3000 }); - await server.start(); - - const tasks = []; - for (let i = 0; i < count; i++) { - tasks.push(test()); - } - - await Promise.all(tasks); - - console.log("logging in 5secs"); - setTimeout(async () => { - await test(); - - process.exit(); - }, 5000); -} -main(); - -async function test() { - const res = await fetch("http://localhost:3000/api/v8/guilds/813524615463698433/members/813524464300982272", { - headers: { - authorization: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjgxMzUyNDQ2NDMwMDk4MjI3MiIsImlhdCI6MTYxNDAyOTc0Nn0.6WQiU4D5HHRi3sliHOQe1hsW-hZTEttvdtZuNIdviNI", - }, - }); - - return await res.text(); -}