Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
karma-benchpress
Advanced tools
See https://github.com/angular/benchpress for information about benchpress.
This project allows automated execution of already-built benchpress benchmarks through Karma.
See example/karma-experiment.conf.js for reference configuration and see [example/jasmine-spec-experiment.spec.js] for reference spec.
bpSuite
This plugin comes with an adapter that provides a global function called bpSuite
that allows
imperative execution of a benchmark with custom configuration. bpSuite returns a promise that will
resolve with the result object
it('should be within acceptable limits', function(done) {
bpSuite({url: 'base/largetable/index-auto.html', variable: 'ngBind', numSamples: 15, iterations: 20}).
then(function(result) {
expect(result.$apply.testTime.avg.mean).toBeLessThan(15);
expect(result.create.testTime.avg.mean).toBeLessThan(1500);
done();
}, function(reason) {
console.error('failed because', reason.message);
}).then(null, function(e) { console.error('something went wrong', e); done()});
});
The bpSuite
options object can have the following properties:
| Property | Required | Description |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| url | yes | Url of the benchmark to be executed (ie. base/largetable/index-auto.html
) |
| variable | no | Benchpress variable with which to run the benchmarks |
| numSamples | no | How many samples to collect. Will use benchpress default (currently 20) if not specified |
| iterations | no | How many iterations to run (should be greater than samples). Will use benchpress default (currently 25) if not specified |
The adapter will serialize all non-reserved properties into query parameters in the benchmark's url, so any supported benchpress paramaters may be used here.
The result object has the following structure:
{
stepName1 : ...,
stepName2: {
testTime: {
avg: {
mean: 5.0, //milliseconds of how long the step took to execute
stdDev: 0.1, //Standard deviation of sample
coefficientOfVariation: 0.02 //stdDev as percentage of mean
},
min: 4,
max: 6,
history: [
4.0,
5.0,
6.0
]
},
//All other measured characteristics have the same structure, though they may represent values other than time
gcTime: ..., //time spent collecting garbage after this step
garbageCount: ..., //how much garbage was generated during this step in KB
retainedCount: ..., //how much memory is retained by the step
}
}
jasmine.DEFAULT_TIMEOUT_INTERVAL
should be set to a number high enough to run all iterations of the benchmark. This would be best inside of a beforeEach/afterEach which will set the interval back to its original valuebpSuite
function have no dependency on Jasmine, though Jasmine is the only framework with which it has been tested.FAQs
Karma plugin to run angular-benchpress benchmarks.
We found that karma-benchpress 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.