artillery-plugin-apdex 1.17.0 → 1.18.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.
- package/index.js +3 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const debug = require('debug')('plugin:apdex');
|
|
5
|
+
const _debug = require('debug')('plugin:apdex');
|
|
8
6
|
|
|
9
7
|
const METRICS = {
|
|
10
8
|
satisfied: 'apdex.satisfied',
|
|
@@ -30,12 +28,12 @@ class ApdexPlugin {
|
|
|
30
28
|
script.config.processor = {};
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
script.scenarios.forEach(
|
|
31
|
+
script.scenarios.forEach((scenario) => {
|
|
34
32
|
scenario.afterResponse = [].concat(scenario.afterResponse || []);
|
|
35
33
|
scenario.afterResponse.push('apdexAfterResponse');
|
|
36
34
|
});
|
|
37
35
|
|
|
38
|
-
function apdexAfterResponse(
|
|
36
|
+
function apdexAfterResponse(_req, res, _userContext, events, done) {
|
|
39
37
|
const total = res.timings.phases.total;
|
|
40
38
|
events.emit('counter', METRICS.satisfied, 0);
|
|
41
39
|
events.emit('counter', METRICS.tolerated, 0);
|