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

stream-bench

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-bench

Node streams benchmarking (throughput, etc)

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
84
increased by18.31%
Maintainers
1
Weekly downloads
 
Created
Source

Benchmark binary streams. Mostly a copy paste of benchmark/net-pipe

Usage

var streamBench = require('stream-bench')
  , http        = require('http')
  , fs          = require('fs')

http.get('http://nodejs.org/dist/latest/node-v0.8.19.tar.gz', function (res) {
  var out = fs.createWriteStream('./out')

  var bench = streamBench({
    interval: 100,
    metric:   'mbytes'
  })

  bench.on('rate', function (rate) {
    console.log('rate: ', rate)
  })

  bench.once('report', function (report) {
    console.log(report)
  })

  res.pipe(bench).pipe(out)
})

Options

All the options are passed to the underlying stream, so lowWaterMark, highWaterMark, bufferSize, etc are all valid.

  • interval: How often to calculate throughput (in ms)
  • rate: In what metric to report (bits, kbits, mbits, gbits, bytes, kbytes, mbytes, gbytes)

TODO

  • tests
  • custom calculator function (eg for object streams)

Keywords

FAQs

Package last updated on 12 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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