Socket
Socket
Sign inDemoInstall

insomnia-plugin-load-test-timing

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

54

load-test-timing.js

@@ -36,3 +36,3 @@ const css = `

{
label: 'Load Test',
label: "Load Test",
action: async (context, data) => {

@@ -43,8 +43,8 @@ let numIterations, delayBetweenRequests, runInParallel;

const numIterationsPrompt = await context.app.prompt(
'How many iterations? (1/3)',
"How many iterations? (1/3)",
{
label: '# Iterations',
defaultValue: '10',
label: "# Iterations",
defaultValue: "10",
cancelable: true,
submitName: 'Next'
submitName: "Next"
}

@@ -56,8 +56,8 @@ );

const delayBetweenRequestsPrompt = await context.app.prompt(
'Second delay between requests? (2/3)',
"Second delay between requests? (2/3)",
{
label: '# Seconds',
defaultValue: '1',
label: "# Seconds",
defaultValue: "1",
cancelable: true,
submitName: 'Next'
submitName: "Next"
}

@@ -69,5 +69,5 @@ );

const bStr = (
await context.app.prompt('Run all requests in parallel? (3/3)', {
label: 'Run in parallel (Y/N)',
defaultValue: 'N',
await context.app.prompt("Run all requests in parallel? (3/3)", {
label: "Run in parallel (Y/N)",
defaultValue: "N",
cancelable: true

@@ -80,6 +80,6 @@ })

runInParallel =
bStr === 'y' || bStr === 'yes' || bStr === 'true' || bStr === '1';
bStr === "y" || bStr === "yes" || bStr === "true" || bStr === "1";
} catch (err) {
if (!err.message || !err.message.endsWith('cancelled')) {
context.app.alert('Unknown Error Occurred', err.message || '?');
if (!err.message || !err.message.endsWith("cancelled")) {
context.app.alert("Unknown Error Occurred", err.message || "?");
console.log(err);

@@ -98,3 +98,3 @@ }

<b># Iterations:</b> [${numIterations}] <b>Delay between requests:</b> [${delayBetweenRequests}s] <b>Run:</b>
[${runInParallel ? 'in Parallel' : 'Serially'}]
[${runInParallel ? "in Parallel" : "Serially"}]
</header>`;

@@ -111,6 +111,6 @@

const recorder = responses => {
const recorder = (responses, j) => {
responses.forEach((response, i) => {
if (response.statusCode.toString().startsWith('2')) {
const result = results[i];
if (response.statusCode.toString().startsWith("2")) {
const result = results[j || i];
result.successes++;

@@ -129,3 +129,3 @@ result.total += response.elapsedTime;

const runIt = async currentIteration => {
console.log('Run # ' + (currentIteration + 1));
console.log("Run # " + (currentIteration + 1));

@@ -136,3 +136,3 @@ if (runInParallel) {

for (let j = 0; j < requests.length; j++) {
recorder(await sendRequests([requests[j]]));
recorder(await sendRequests([requests[j]]), j);
}

@@ -163,8 +163,8 @@ }

let color = '';
let color = "";
if (result.successes === numIterations) {
color = 'limegreen';
color = "limegreen";
} else {
color = 'red';
color = "red";
}

@@ -183,7 +183,7 @@

const html =
startHtml + header + startTableHtml + rows.join('') + endHtml;
startHtml + header + startTableHtml + rows.join("") + endHtml;
context.app.showGenericModalDialog('Results', { html });
context.app.showGenericModalDialog("Results", { html });
} catch (err) {
context.app.alert('Unknown Error Occurred', err.message);
context.app.alert("Unknown Error Occurred", err.message);
console.log(err);

@@ -190,0 +190,0 @@ }

{
"name": "insomnia-plugin-load-test-timing",
"version": "1.0.0",
"version": "1.0.1",
"main": "load-test-timing.js",

@@ -5,0 +5,0 @@ "insomnia": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc