Skip to content

Commit

Permalink
Merge pull request #1170 from botpress/wip/11.1
Browse files Browse the repository at this point in the history
feat: release v11.1
  • Loading branch information
slvnperron committed Nov 28, 2018
2 parents 46407b8 + 8c05866 commit 70b5020
Show file tree
Hide file tree
Showing 185 changed files with 6,528 additions and 4,999 deletions.
10 changes: 10 additions & 0 deletions bench/README.md
@@ -0,0 +1,10 @@
# Botpress Benchmark

##How to run

Botpress has to be running

```
yarn
yarn start
```
11 changes: 11 additions & 0 deletions bench/functions.js
@@ -0,0 +1,11 @@
let testId = null

exports.setupTestId = function setupTestId(context, events, done) {
if (!testId) {
testId = Math.random()
.toString(16)
.substr(2)
}
context.vars['testId'] = testId
return done()
}
16 changes: 16 additions & 0 deletions bench/package.json
@@ -0,0 +1,16 @@
{
"name": "bench",
"version": "1.0.0",
"description": "Benchmark Utility for Botpress Server",
"main": "index.js",
"author": "Botpress, Inc.",
"license": "AGPL-3.0",
"private": true,
"scripts": {
"web": "artillery run ./stress_channel_web.yml",
"api": "artillery run ./stress_channel_api.yml"
},
"dependencies": {
"artillery": "^1.6.0-25"
}
}
22 changes: 22 additions & 0 deletions bench/stress_channel_api.yml
@@ -0,0 +1,22 @@
config:
target: 'http://localhost:3000'
phases:
- duration: 10 # lasts for 'X' seconds
arrivalRate: 1 # 'X' new users per second
payload:
path: 'users.csv'
fields: ['prefix', 'uuid']
order: 'sequence'
processor: './functions.js'
scenarios:
- name: Each user sends 'X' messages to channel-api
flow:
- log: Testing channel-api
- function: 'setupTestId'
- loop:
- post:
url: '/api/v1/bots/welcome-bot/converse/{{ prefix }}{{ testId }}_{{ uuid }}'
json:
type: 'text'
text: 'U{{ testId }}_{{ uuid }}|M{{ $loopCount }}'
count: 50
22 changes: 22 additions & 0 deletions bench/stress_channel_web.yml
@@ -0,0 +1,22 @@
config:
target: 'http://localhost:3000'
phases:
- duration: 10 # lasts for 'X' seconds
arrivalRate: 1 # 'X' new users per second
payload:
path: 'users.csv'
fields: ['prefix', 'uuid']
order: 'sequence'
processor: './functions.js'
scenarios:
- name: Each user sends 'X' messages to channel-web
flow:
- log: Testing channel-web
- function: 'setupTestId'
- loop:
- post:
url: '/api/v1/bots/welcome-bot/mod/channel-web/messages/{{ prefix }}{{ testId }}_{{ uuid }}'
json:
type: 'text'
text: 'U{{ testId }}_{{ uuid }}|M{{ $loopCount }}'
count: 50

0 comments on commit 70b5020

Please sign in to comment.