Skip to content

Commit

Permalink
fix: allow workload script to be disabled (#59)
Browse files Browse the repository at this point in the history
The apm-integration-testing project will set the `WORKLOAD_DISABLED`
environment variable based on the `--no-opbeans-node-loadgen` command
line flag.
  • Loading branch information
watson authored Aug 6, 2019
1 parent 188e956 commit ac00d57
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions ecosystem-workload.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
module.exports = {
'use strict'

const config = {
apps: [{
name: 'server',
script: './server.js',
instances: 1
}]
}

if (process.env.WORKLOAD_DISABLED !== 'True') {
config.apps.push({
name: 'workload',
script: './node_modules/.bin/workload',
args: '-f .workload.js',
instances: 1,
restart_delay: 2000
}, {
name: 'server',
script: './server.js',
instances: 1
}]
})
}

module.exports = config

0 comments on commit ac00d57

Please sign in to comment.