How to use the autocannon.track function in autocannon

To help you get started, we’ve selected a few autocannon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nearform / udaru / packages / udaru-hapi-server / bench / util / runner.js View on Github external
headers: params.headers,
  body: params.body
}

// Create the test and finish handler.
const instance = Autocannon(opts, (err, result) => {
  if (err) {
    console.error(err)
    process.exit(-1)
  }

  console.log('Detailed Result:', '\n\n', result)
})

// Starts the test and shows a pretty progress bar while it runs
Autocannon.track(instance)
github davidmarkclements / fast-date / bench / http.js View on Github external
function run (opts, cb) {
  console.log('\n===========Benching ' + opts.title + '=============')
  var instance = autocannon(opts, cb)
  autocannon.track(instance)
}
github mcollina / autocannon-ci / autocannon-ci.js View on Github external
runner.on('bench', function (data, cannon) {
    process.stdout.write('==> ')
    autocannon.track(cannon)
    cannon.on('done', function () {
      console.log()
    })
  })
github nearform / node-clinic-bubbleprof-examples / server-side-rendering / stories.js View on Github external
]

const instance = autocannon({
  title: 'ssr-example',
  url,
  connections: 10,
  pipelining: 1,
  duration: 10,
  requests,
}, console.log)

process.once('SIGINT', () => {
  instance.stop()
})

autocannon.track(instance)
github fastify / fastify-etag / benchmarks / run.js View on Github external
const shoot = (port) => new Promise((resolve) => {
  const opts = {
    url: `http://localhost:${port}/`,
    connections: 100,
    pipelining: 4,
    duration: 30,
    timeout: 30
  }

  currentBenchmark = autocannon(opts)
  currentBenchmark.once('done', resolve)
  autocannon.track(currentBenchmark, { renderResultsTable: false })
})
github restify / node-restify / benchmark / lib / autocannon.js View on Github external
var instance = autocannon(opts, function onResult(err, result) {
        if (err) {
            cb(err);
            return;
        }

        if (save) {
            writeResult(handler, version, result);
        }

        cb();
    });

    if (opts.track && save) {
        autocannon.track(instance);
    }
}
github adobe / athena / src / engines / autocannonEngine.js View on Github external
});

        stats.rpsMap.push({
          count: stats.rpsCount,
          date: now,
        });

        stats.rpsCount = 0;
      }, 1000);

      engine.on('done', function(results) {
        delete stats.rpsCount;
        clearInterval(interval);
      });

      autocannon.track(engine, {
        renderProgressBar: true,
      });
    };
github nearform / udaru / packages / udaru-hapi-server / bench / util / volumeRunner.js View on Github external
duration: DURATION,
    connections: CONNECTIONS,
    headers: {
      authorization: 'ROOTid',
      org: 'CONCH'
    },
    requests: [
      {
        method: 'GET',
        path: getPath()
      }
    ],
    setupClient: setupClient
  }, onComplete)

  autocannon.track(instance, {renderProgressBar: !DEBUG})

  instance.on('response', onResponse)
}

autocannon

Fast HTTP benchmarking tool written in Node.js

MIT
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis

Popular autocannon functions