-
-
Save pafnuty/04f001bb476f1705fc376f736ea366bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.env.TS_NODE_PROJECT = './tsconfig.json'; | |
import * as moment from 'moment' | |
import * as mocha from 'mocha'; | |
import { assert } from 'chai'; | |
import axios from "axios"; | |
const run = async () => { | |
await describe('site load testing', async () => { | |
it('Lets go!', async () => { | |
/* ALERT!!!! */ | |
const processCount = 2000; | |
const testUrl = 'http://localhost:80/user/getUserInfo'; | |
async function testFnc(counter: number) { | |
let startTime = moment().format('mm:ss'); | |
let resp = await axios.get(testUrl, {}); | |
console.log('Time:: ' + startTime + '-' + moment().format('mm:ss'), ' , Cunter:: ' + counter + ' , Status:: ' + resp.status); | |
} | |
for (let i = 0; i < processCount; i++) { | |
testFnc(i); | |
} | |
assert.ok(true); | |
}).timeout(5000); | |
}); | |
}; | |
run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment