Skip to content

Instantly share code, notes, and snippets.

View agusrichard's full-sized avatar

Agus Richard Lubis agusrichard

View GitHub Profile
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb-base",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
import express from 'express'
const app = express()
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(5000, () => {
"scripts": {
"build": "tsc",
"dev": "node ./build/index.js"
},
const hello: string = 'Hello World!'
console.log(hello)
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Language and Environment */
"target": "es6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
"rootDir": "./src", /* Specify the root folder within your source files. */
export const options = {
stages: [
{ duration: '2m', target: 400 }, // ramp up to 400 users
{ duration: '3h56m', target: 400 }, // stay at 400 for ~4 hours
{ duration: '2m', target: 0 }, // scale down. (optional)
],
};
export const options = {
stages: [
{ duration: '10s', target: 100 }, // below normal load
{ duration: '1m', target: 100 },
{ duration: '10s', target: 1400 }, // spike to 1400 users
{ duration: '3m', target: 1400 }, // stay at 1400 for 3 minutes
{ duration: '10s', target: 100 }, // scale down. Recovery stage.
{ duration: '3m', target: 100 },
{ duration: '10s', target: 0 },
],
export const options = {
stages: [
{ duration: '2m', target: 100 }, // below normal load
{ duration: '5m', target: 100 },
{ duration: '2m', target: 200 }, // normal load
{ duration: '5m', target: 200 },
{ duration: '2m', target: 300 }, // around the breaking point
{ duration: '5m', target: 300 },
{ duration: '2m', target: 400 }, // beyond the breaking point
{ duration: '5m', target: 400 },
export const options = {
vus: 1, // 1 user looping for 1 minute
duration: '1m',
thresholds: {
http_req_duration: ['p(99)<1500'], // 99% of requests must complete below 1.5s
},
};
export const options = {
stages: [
{ duration: '5m', target: 100 }, // simulate ramp-up of traffic from 1 to 100 users over 5 minutes.
{ duration: '10m', target: 100 }, // stay at 100 users for 10 minutes
{ duration: '5m', target: 0 }, // ramp-down to 0 users
],
thresholds: {
'http_req_duration': ['p(99)<1500'], // 99% of requests must complete below 1.5s
'logged in successfully': ['p(99)<1500'], // 99% of requests must complete below 1.5s
},