
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Just a super easy load-testing framework.
Freeloader uses 4 basic keywords:
request
to create an HTTP request using unirestemit
to push the request down the pipelinesend
to make the actual HTTP calljoin
to join 2 streams togetherThe simplest test looks like:
require('freeloader').global();
// See unirest documentation for all the options (headers, file uploads...)
var r = request.get('http://localhost:3000/people')
.header('Accept', 'application/json');
emit(r).pipe(send());
That's it! This test sends a single HTTP request, and finishes as soon as the response is received.
It becomes a lot more interesting when we start building a pipeline. Each step in the pipeline has access to all requests & responses. They can modify payloads, generate more requests, or collect data for reporting.
freeloader-bundle contains a lot of useful modules to get started. Each module is an instance of a Node.js stream, and you can also easily create your own.
require('freeloader-bundle').global();
emit(r)
.pipe(stopTimer('30s'))
.pipe(concurrent(50))
.pipe(transform(randomData))
.pipe(progressDots())
.pipe(consoleSummary())
.pipe(responseTimeGraph('./graph.jpg'))
.pipe(send())
Which outputs something like:
............................................................
....................................................
Waiting for pending requests to finish...
Response count = 112
Response times
Min = 16ms
Max = 182ms
Mean = 66ms
Median = 58ms
75th percentile = 82ms
95th percentile = 150ms
The test suite will end:
Ctrl-C
Test pipelines can easily be included in a CI test suite:
it('generates load test reports', function(done) {
emit(r1)
.pipe(times(50))
.pipe(jsonSummary('./report.json'))
.pipe(callback(done))
.pipe(send());
});
Streams can also be joined for more complex scenarios. Here are a few examples:
join(emit(r1), emit(r2))
.pipe(concurrent(50))
.pipe(summary())
.pipe(send());
var s1 = emit(r1).pipe(concurrent(50));
var s2 = emit(r2).pipe(concurrent(50));
join(s1, s2)
.pipe(summary())
.pipe(send());
It's up to each reporter to either give global stats, or group the report by request URL.
FAQs
Stream-based HTTP load testing framework
We found that freeloader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.