@artilleryio/int-core 2.14.0-d77b7a2 → 2.15.0-69dd606

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.
@@ -403,15 +403,23 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
403
403
  requestParams.formData,
404
404
  function (acc, v, k) {
405
405
  let V = template(v, context);
406
- if (V && _.isPlainObject(V) && V.fromFile) {
407
- const absPath = path.resolve(
408
- path.dirname(context.vars.$scenarioFile),
409
- V.fromFile
410
- );
411
- fileUpload = absPath;
412
- V = fs.createReadStream(absPath);
406
+ let options;
407
+ if (V && _.isPlainObject(V)) {
408
+ if (V.contentType) {
409
+ options = { contentType: V.contentType };
410
+ }
411
+ if (V.fromFile) {
412
+ const absPath = path.resolve(
413
+ path.dirname(context.vars.$scenarioFile),
414
+ V.fromFile
415
+ );
416
+ fileUpload = absPath;
417
+ V = fs.createReadStream(absPath);
418
+ } else if (V.value) {
419
+ V = V.value;
420
+ }
413
421
  }
414
- acc.append(k, V);
422
+ acc.append(k, V, options);
415
423
  return acc;
416
424
  },
417
425
  f
@@ -815,6 +823,34 @@ HttpEngine.prototype._handleResponse = function (
815
823
  ee.emit('counter', 'http.responses', 1);
816
824
  // ee.emit('rate', 'http.response_rate');
817
825
  ee.emit('histogram', 'http.response_time', res.timings.phases.firstByte);
826
+
827
+ const statusCode = res.statusCode;
828
+ if (statusCode >= 200 && statusCode < 300) {
829
+ ee.emit(
830
+ 'histogram',
831
+ 'http.response_time.2xx',
832
+ res.timings.phases.firstByte
833
+ );
834
+ } else if (statusCode >= 300 && statusCode < 400) {
835
+ ee.emit(
836
+ 'histogram',
837
+ 'http.response_time.3xx',
838
+ res.timings.phases.firstByte
839
+ );
840
+ } else if (statusCode >= 400 && statusCode < 500) {
841
+ ee.emit(
842
+ 'histogram',
843
+ 'http.response_time.4xx',
844
+ res.timings.phases.firstByte
845
+ );
846
+ } else if (statusCode >= 500 && statusCode < 600) {
847
+ ee.emit(
848
+ 'histogram',
849
+ 'http.response_time.5xx',
850
+ res.timings.phases.firstByte
851
+ );
852
+ }
853
+
818
854
  if (this.extendedHTTPMetrics) {
819
855
  ee.emit('histogram', 'http.dns', res.timings.phases.dns);
820
856
  ee.emit('histogram', 'http.tcp', res.timings.phases.tcp);
package/lib/runner.js CHANGED
@@ -10,11 +10,8 @@ const _ = require('lodash');
10
10
  const debug = require('debug')('runner');
11
11
  const debugPerf = require('debug')('perf');
12
12
  const uuidv4 = require('uuid').v4;
13
- const A = require('async');
14
13
  const { SSMS } = require('./ssms');
15
- const tryResolve = require('try-require').resolve;
16
14
  const createPhaser = require('./phases');
17
- const isIdlePhase = require('./is-idle-phase');
18
15
  const createReader = require('./readers');
19
16
  const engineUtil = require('@artilleryio/int-commons').engine_util;
20
17
  const wl = require('./weighted-pick');
@@ -223,15 +220,9 @@ function run(script, ee, options, runState, contextVars) {
223
220
  });
224
221
  phaser.on('phaseStarted', function (spec) {
225
222
  ee.emit('phaseStarted', spec);
226
- if (isIdlePhase(spec)) {
227
- ee.emit('stats', SSMS.empty());
228
- }
229
223
  });
230
224
  phaser.on('phaseCompleted', function (spec) {
231
225
  ee.emit('phaseCompleted', spec);
232
- if (isIdlePhase(spec)) {
233
- ee.emit('stats', SSMS.empty());
234
- }
235
226
  });
236
227
  phaser.on('done', function () {
237
228
  debug('All phases launched');
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@artilleryio/int-core",
3
- "version": "2.14.0-d77b7a2",
3
+ "version": "2.15.0-69dd606",
4
4
  "main": "./index.js",
5
5
  "license": "MPL-2.0",
6
6
  "dependencies": {
7
- "@artilleryio/int-commons": "2.10.0-d77b7a2",
7
+ "@artilleryio/int-commons": "2.11.0-69dd606",
8
8
  "@artilleryio/sketches-js": "^2.1.1",
9
9
  "agentkeepalive": "^4.1.0",
10
10
  "arrivals": "^2.1.2",
@@ -31,7 +31,6 @@
31
31
  "socket.io-client": "^4.5.1",
32
32
  "socketio-wildcard": "^2.0.0",
33
33
  "tough-cookie": "^5.0.0-rc.2",
34
- "try-require": "^1.2.1",
35
34
  "uuid": "^8.0.0",
36
35
  "ws": "^7.5.7"
37
36
  },
@@ -58,7 +57,7 @@
58
57
  "proxy": "^2.1.1",
59
58
  "rewiremock": "^3.14.3",
60
59
  "sinon": "^4.5.0",
61
- "socket.io": "^4.7.1",
60
+ "socket.io": "^4.8.0",
62
61
  "tap": "^19.0.2"
63
62
  }
64
63
  }