performance
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -16,5 +16,6 @@ #!/usr/bin/env node | ||
var options = stdio.getopt({ | ||
file: {key: 'f', args: 1, description: 'Output results to a file'}, | ||
json: {key: 'j', description: 'Show benchmark results in JSON format'}, | ||
seconds: {key: 's', args: 1, description: 'Number of seconds to run'}, | ||
version: {key: 'v', description: 'Show version number and exit'}, | ||
json: {key: 'j', description: 'Show benchmark results in JSON format'}, | ||
}); | ||
@@ -28,2 +29,1 @@ if (options.version) | ||
performance.runBenchmarks(options); | ||
@@ -10,2 +10,4 @@ 'use strict'; | ||
require('prototypes'); | ||
var Console = require('console').Console; | ||
var createWriteStream = require('fs').createWriteStream; | ||
var crypto = require('crypto'); | ||
@@ -29,3 +31,5 @@ var util = require('util'); | ||
var console = global.console; | ||
/** | ||
@@ -38,2 +42,3 @@ * Run all performance benchmarks. | ||
spanMs = 1000 * options.seconds || TIME; | ||
if (options.file) console = new Console(createWriteStream(options.file)); | ||
if (!options.json) log.info('Running benchmarks for %s ms', spanMs); | ||
@@ -275,2 +280,1 @@ var longArray = []; | ||
} | ||
{ | ||
"name": "performance", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A short and quick way to assess performance on a server.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/performance", |
@@ -30,7 +30,15 @@ # performance | ||
#### Options | ||
* *file*: Output results to a file. `performance --file out.txt` is equivalent | ||
to `performance > out.txt` | ||
* *json*: Show benchmark results in JSON format | ||
* *seconds*: Number of seconds to run | ||
* *version*: Show version number and exit | ||
### Programmatic Use | ||
Once installed, you can use performance from your own packages. | ||
Simply require it, | ||
and invoke the function `runBenchmarks()`: | ||
Once installed, you can use performance from your own packages. Simply require | ||
it, and invoke the function `runBenchmarks()`. It accept an object with the same | ||
options as running it from the CLI: | ||
@@ -127,2 +135,1 @@ ``` | ||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
14553
302
134
2