Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

artillery-engine-kinesis

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

artillery-engine-kinesis - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

LICENSE.txt

62

index.js

@@ -0,1 +1,5 @@

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Kinesis = require('aws-sdk/clients/kinesis');

@@ -6,3 +10,3 @@ const debug = require('debug')('engine:kinesis');

function KinesisEngine(script, ee, helpers) {
function KinesisEngine (script, ee, helpers) {
this.script = script;

@@ -15,10 +19,4 @@ this.ee = ee;

// Called externally from runner
KinesisEngine.prototype.createScenario = function createScenario(scenarioSpec, ee) {
// Skeleton working
// Write a test
// Make think, loop, and putRecord work
let tasks = scenarioSpec.flow.map((rs) => {
return this.step(rs, ee);
});
KinesisEngine.prototype.createScenario = function createScenario (scenarioSpec, ee) {
const tasks = scenarioSpec.flow.map(rs => this.step(rs, ee));

@@ -28,9 +26,7 @@ return this.compile(tasks, scenarioSpec.flow, ee);

KinesisEngine.prototype.step = function step(rs, ee) {
KinesisEngine.prototype.step = function step (rs, ee) {
const self = this;
if (rs.loop) {
let steps = rs.loop.map((loopStep) => {
return this.step(loopStep, ee);
});
const steps = rs.loop.map(loopStep => this.step(loopStep, ee));

@@ -41,4 +37,4 @@ return this.helpers.createLoopWithCount(rs.count || -1, steps);

if (rs.log) {
return function log(context, callback) {
return process.nextTick(function() { callback(null, context); });
return function log (context, callback) {
return process.nextTick(function () { callback(null, context); });
};

@@ -52,9 +48,9 @@ }

if (rs.function) {
return function(context, callback) {
return function (context, callback) {
let func = self.config.processor[rs.function];
if (!func) {
return process.nextTick(function() { callback(null, context); });
return process.nextTick(function () { callback(null, context); });
}
return func(context, ee, function() {
return func(context, ee, function () {
return callback(null, context);

@@ -66,6 +62,6 @@ });

if (rs.putRecord) {
return function putRecord(context, callback) {
const data = typeof rs.putRecord.data === 'object' ?
JSON.stringify(rs.putRecord.data) :
String(rs.putRecord.data);
return function putRecord (context, callback) {
const data = typeof rs.putRecord.data === 'object'
? JSON.stringify(rs.putRecord.data)
: String(rs.putRecord.data);

@@ -81,3 +77,3 @@ const params = {

ee.emit('request');
context.kinesis.putRecord(params, function(err, data) {
context.kinesis.putRecord(params, function (err, data) {
if (err) {

@@ -96,3 +92,3 @@ debug(err);

return function(context, callback) {
return function (context, callback) {
return callback(null, context);

@@ -102,7 +98,15 @@ };

KinesisEngine.prototype.compile = function compile(tasks, scenarioSpec, ee) {
KinesisEngine.prototype.compile = function compile (tasks, scenarioSpec, ee) {
const self = this;
return function scenario(initialContext, callback) {
const init = function init(next) {
initialContext.kinesis = new Kinesis({ region: self.script.config.kinesis.region });
return function scenario (initialContext, callback) {
const init = function init (next) {
let opts = {
region: self.script.config.kinesis.region || 'us-east-1'
};
if (self.script.config.kinesis.endpoint) {
opts.endpoint = self.script.config.kinesis.endpoint;
}
initialContext.kinesis = new Kinesis(opts);
ee.emit('started');

@@ -116,3 +120,3 @@ return next(null, initialContext);

steps,
function done(err, context) {
function done (err, context) {
if (err) {

@@ -119,0 +123,0 @@ debug(err);

{
"name": "artillery-engine-kinesis",
"version": "1.0.0",
"version": "1.1.0",
"description": "Load test AWS Kinesis with Artillery.io",

@@ -8,3 +8,4 @@ "main": "index.js",

"test": "node test/index.js",
"commitmsg": "conventional-changelog-lint -e"
"commitmsg": "conventional-changelog-lint -e",
"precommit": "semistandard"
},

@@ -21,3 +22,2 @@ "keywords": [

"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.1.3",
"eslint-config-standard": "^10.2.1",

@@ -29,2 +29,3 @@ "eslint-plugin-import": "^2.2.0",

"husky": "^0.13.3",
"semistandard": "^11.0.0",
"tape": "^4.6.3"

@@ -35,4 +36,5 @@ },

"aws-sdk": "^2.45.0",
"debug": "^2.6.6",
"lodash": "^4.17.4"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc