Skip to content

Instantly share code, notes, and snippets.

@elexfreeman
Created September 1, 2019 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elexfreeman/008be93096356cc26364e3cb419361cb to your computer and use it in GitHub Desktop.
Save elexfreeman/008be93096356cc26364e3cb419361cb to your computer and use it in GitHub Desktop.
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