Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.