Generate json results for benchmark.js.
- Dont work outside the travis environment.
- Write results into file
travisBuildId.json
. - Other config same as in travis-json-git-log, but with
build
andjob
fields for additional benchmark info.
var Benchmark = require('benchmark');
var tb = require('travis-benchmark');
var suite = new Benchmark.Suite('suiteName');
tb.wrapSuite(suite/*, callback, config*/);
.run({ 'async': true });
or
var Benchmark = require('benchmark');
var tb = require('travis-benchmark');
var tjgl = require('travis-json-git-log');
var suite = new Benchmark.Suite('suiteName');
suite.add('benchmarkName', function() {})
.on('complete', function(event) {
var data = exports.parseSuite(event);
tjgl.tjgl(
_.extend({}, { data }, config),
function(error, context, config) {}
);
})
.run({ 'async': true });
Result json file will contains:
- build: number
- job: number
- platform: string
- version: string
- layout: string?
- os: string
- suite: string?
- benchmark: string?
- speed: number
- distortion: number
- sampled: number
- percent: number
- error?: string