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