Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
karma-benchmark-json-reporter
Advanced tools
Readme
A reporter for karma-benchmark outputting results to a JSON file.
npm install karma-benchmark-json-reporter
After installing karma
, karma-benchmark and your favorite
launcher, in your karma.conf.js
:
module.exports = function (config) {
config.set({
frameworks: ['benchmark'],
reporters: ['benchmark-json'],
// other karma options
// options for 'karma-benchmark-json-reporter'
benchmarkJsonReporter: {
pathToJson: 'my-benchmark-results.json'
}
})
}
See complete working examples for more details.
The benchmarkJsonReporter
option container has three settings:
pathToJson
String or array of strings corresponding to the path(s) from the karma basePath
of the output JSON file(s).
Default: results.json
from the karma basePath
.
By setting pathToJson
to an array of paths and customizing formatOutput
, one
can generate multiple output files. See this example for more.
formatResults
Function that takes in the compiled results array and is expected to return an
object that is passed to formatOutput
.
Default: the identity function.
Each compiled results item corresponds to one benchmark run has the following keys:
fullName
: full (and unique) run name concatenating browser
, suite
and
name
valuesbrowser
: name of browser usedsuite
: name of suite (as set in suite('<>', function () {}
)name
: name of benchmark (as set in benchmark('<>', function () {}
)count
: number of times the test was executedcycles
: number of cycles performed while benchmarkinghz
: number of operations per secondhzDeviation
: standard deviation in hzmean
: mean in secondsdeviation
: standard deviation in secondsvariance
: variance in seconds^2moe
: margin of errorrme
: relative margin of error (in percentage of the mean)sem
: standard error of the meansample
: list of sample pointsNote that the compiled results are sorted from fastest to slowest hz
values
before being passed to formatResults
.
formatOutput
Function that takes the output of formatResults
and is expected to return a
JSON-serializable object that will be written in the output file(s).
Defaults: function (results) { return { results: results } }
.
If formatOutput
returns an array, then items in the array will be written in
separate JSON files in the same order as the given pathToJson
array setting.
Otherwise, the formatOutput
return value gets JSON stringified into a single
JSON file located at pathToJson
.
2018 Étienne Tétreault-Pinard. MIT License
FAQs
A reporter for karma-benchmark outputting results to a JSON file
The npm package karma-benchmark-json-reporter receives a total of 34 weekly downloads. As such, karma-benchmark-json-reporter popularity was classified as not popular.
We found that karma-benchmark-json-reporter 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.