artillery-plugin-apdex 1.14.0-ec9481d → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -11,6 +11,7 @@ const METRICS = {
11
11
  tolerated: 'apdex.tolerated',
12
12
  frustrated: 'apdex.frustrated'
13
13
  };
14
+
14
15
  class ApdexPlugin {
15
16
  constructor(script, _events) {
16
17
  this.script = script;
@@ -21,8 +22,8 @@ class ApdexPlugin {
21
22
  typeof process.env.LOCAL_WORKER_ID !== 'undefined'
22
23
  ) {
23
24
  const t =
24
- script.config.apdex?.threshold ||
25
- script.config.plugins.apdex?.threshold ||
25
+ script.config.apdex?.threshold ??
26
+ script.config.plugins?.apdex?.threshold ??
26
27
  500;
27
28
 
28
29
  if (!script.config.processor) {
@@ -59,10 +60,11 @@ class ApdexPlugin {
59
60
  global.artillery.ext({
60
61
  ext: 'beforeExit',
61
62
  method: async (testInfo) => {
62
- if (
63
- typeof this.script?.config?.apdex === 'undefined' ||
64
- typeof process.env.ARTILLERY_DISABLE_ENSURE !== 'undefined'
65
- ) {
63
+ const hasApdexConfig =
64
+ this.script?.config?.apdex !== undefined ||
65
+ this.script?.config?.plugins?.apdex !== undefined;
66
+
67
+ if (!hasApdexConfig) {
66
68
  return;
67
69
  }
68
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artillery-plugin-apdex",
3
- "version": "1.14.0-ec9481d",
3
+ "version": "1.15.0",
4
4
  "description": "Calculate and report Apdex scores",
5
5
  "main": "index.js",
6
6
  "scripts": {