refactor(benchmarks): rename `timeBenchmark` into `benchmark`
This commit is contained in:
parent
458b2d7215
commit
82b1601a31
|
@ -9,7 +9,7 @@ describe('ng2 change detection benchmark', function () {
|
|||
|
||||
it('should log ng stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#ng2DetectChanges'],
|
||||
logId: 'ng2.changeDetection'
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ describe('ng2 change detection benchmark', function () {
|
|||
|
||||
it('should log baseline stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#baselineDetectChanges'],
|
||||
logId: 'baseline.changeDetection'
|
||||
});
|
||||
|
@ -25,12 +25,12 @@ describe('ng2 change detection benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('ng2 compiler benchmark', function () {
|
|||
|
||||
it('should log withBindings stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#compileWithBindings'],
|
||||
logId: 'ng2.compile.withBindings'
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ describe('ng2 compiler benchmark', function () {
|
|||
|
||||
it('should log noBindings stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#compileNoBindings'],
|
||||
logId: 'ng2.compile.noBindings'
|
||||
});
|
||||
|
@ -25,12 +25,12 @@ describe('ng2 compiler benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('ng2 di benchmark', function () {
|
|||
|
||||
it('should log the stats for getByToken', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#getByToken'],
|
||||
logId: 'ng2.di.getByToken'
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ describe('ng2 di benchmark', function () {
|
|||
|
||||
it('should log the stats for getByKey', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#getByKey'],
|
||||
logId: 'ng2.di.getByKey'
|
||||
});
|
||||
|
@ -25,7 +25,7 @@ describe('ng2 di benchmark', function () {
|
|||
|
||||
it('should log the stats for getChild', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#getChild'],
|
||||
logId: 'ng2.di.getChild'
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ describe('ng2 di benchmark', function () {
|
|||
|
||||
it('should log the stats for instantiate', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#instantiate'],
|
||||
logId: 'ng2.di.instantiate'
|
||||
});
|
||||
|
@ -41,12 +41,12 @@ describe('ng2 di benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('ng2 element injector benchmark', function () {
|
|||
|
||||
it('should log the stats for instantiate', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#instantiate'],
|
||||
logId: 'ng2.elementInjector.instantiate'
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ describe('ng2 element injector benchmark', function () {
|
|||
|
||||
it('should log the stats for instantiateDirectives', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#instantiateDirectives'],
|
||||
logId: 'ng2.elementInjector.instantiateDirectives'
|
||||
});
|
||||
|
@ -25,12 +25,12 @@ describe('ng2 element injector benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('ng2 tree benchmark', function () {
|
|||
|
||||
it('should log the ng stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
|
||||
logId: 'ng2.tree'
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ describe('ng2 tree benchmark', function () {
|
|||
|
||||
it('should log the baseline stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#baselineDestroyDom', '#baselineCreateDom'],
|
||||
logId: 'baseline.tree'
|
||||
});
|
||||
|
@ -25,12 +25,12 @@ describe('ng2 tree benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('ng1.x compiler benchmark', function () {
|
|||
|
||||
it('should log withBinding stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#compileWithBindings'],
|
||||
logId: 'ng1.compile.withBindings'
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ describe('ng1.x compiler benchmark', function () {
|
|||
|
||||
it('should log noBindings stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#compileNoBindings'],
|
||||
logId: 'ng1.compile.noBindings'
|
||||
});
|
||||
|
@ -25,12 +25,12 @@ describe('ng1.x compiler benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('ng1.x tree benchmark', function () {
|
|||
|
||||
it('should log the stats', function() {
|
||||
browser.get(URL);
|
||||
runClickTimeBenchmark({
|
||||
runClickBenchmark({
|
||||
buttons: ['#destroyDom', '#createDom'],
|
||||
logId: 'ng1.tree'
|
||||
});
|
||||
|
@ -17,12 +17,12 @@ describe('ng1.x tree benchmark', function () {
|
|||
|
||||
});
|
||||
|
||||
function runClickTimeBenchmark(config) {
|
||||
function runClickBenchmark(config) {
|
||||
var buttons = config.buttons.map(function(selector) {
|
||||
return $(selector);
|
||||
});
|
||||
var timeParams = browser.params.timeBenchmark;
|
||||
benchpress.runTimeBenchmark({
|
||||
var timeParams = browser.params.benchmark;
|
||||
benchpress.runBenchmark({
|
||||
sampleSize: timeParams.sampleSize,
|
||||
targetCoefficientOfVariation: timeParams.targetCoefficientOfVariation,
|
||||
timeout: timeParams.timeout,
|
||||
|
|
|
@ -6,7 +6,7 @@ var config = exports.config = {
|
|||
specs: ['dist/cjs/**/*_perf.js'],
|
||||
|
||||
params: {
|
||||
timeBenchmark: {
|
||||
benchmark: {
|
||||
// size of the sample to take
|
||||
sampleSize: 10,
|
||||
targetCoefficientOfVariation: 4,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var timeBenchmark = require('./src/time_benchmark');
|
||||
var benchmark = require('./src/benchmark');
|
||||
var tools = require('./src/tools');
|
||||
|
||||
module.exports = {
|
||||
runTimeBenchmark: timeBenchmark.runTimeBenchmark,
|
||||
runBenchmark: benchmark.runBenchmark,
|
||||
verifyNoBrowserErrors: tools.verifyNoBrowserErrors
|
||||
};
|
|
@ -20,11 +20,11 @@ var MODE_INDETERMINATE = 'indeterminate';
|
|||
var nextTimestampId = 0;
|
||||
|
||||
module.exports = {
|
||||
runTimeBenchmark: runTimeBenchmark,
|
||||
runBenchmark: runBenchmark,
|
||||
supportedMetrics: SUPPORTED_METRICS
|
||||
};
|
||||
|
||||
function runTimeBenchmark(config, workCallback) {
|
||||
function runBenchmark(config, workCallback) {
|
||||
config.metrics.forEach(function(metric) {
|
||||
if (!(metric in SUPPORTED_METRICS)) {
|
||||
throw new Error('Metric '+metric+' is not suported by benchpress right now');
|
Loading…
Reference in New Issue