Skip to content

Instantly share code, notes, and snippets.

@leduyminh48
leduyminh48 / artillery.yaml
Created May 29, 2021 19:42
Sample Artillery load testing
config:
target: "http://localhost:3000"
phases:
- duration: 30
arrivalRate: 2
name: Warm up
processor: "./processors/users.js"
payload:
-
path: "./payloads/secret.csv"
@Effect()
getAssetAllocation$ = this.action$
.ofType(chart.LOAD_ASSET_ALLOCATION)
.switchMap(() => this.chartService.getAssetAllocation()
.map(data => new chart.AssetAllocationLoaded(data)));
@Effect()
getPerformance$ = this.action$
.ofType(chart.LOAD_PERFORMANCE)
.switchMap(() => this.chartService.getPerformance()
async function processFile(zipFile, outputPath) {
try {
const extractResult = await extract(zipFile, outputPath);
const writeToDb = await db.query();
const addPointForUser = await db.query();
} catch (err) {
// handle error here
return Promise.reject();
}
var BaseClass = (function () {
var privateData = 6;
var controller = function () {};
controller.prototype.getPrivateData = function () {
if (this.hasAccess)
return privateData;
else
throw new Error('No access');
}