11'use strict' ;
22
3- const createRegressionBenchmark = require ( '@clevernature/benchmark-regression' ) ;
4- const { Benchmark } = require ( 'benchmark' ) ;
3+ const Benchmark = require ( 'faceoff' ) . default ;
54const debug = require ( 'debug' ) ( 'benchmark' ) ;
65
76/**
@@ -13,42 +12,18 @@ const debug = require('debug')('benchmark');
1312 * 2018, that situation is unlikely to change soon.
1413 */
1514
16- Benchmark . options . defer = true ;
17- Benchmark . options . onStart = event => {
18- const benchmark = event . target ;
19- const name = benchmark . name ;
20- const original = benchmark . fn ;
21-
22- debug ( `Starting '${ name } '` ) ;
23-
24- benchmark . fn = async deferred => {
25- try {
26- await original ( ) ;
27- } catch ( e ) {
28- console . error ( e ) ;
29- } finally {
30- deferred . resolve ( ) ;
31- }
32- } ;
33- } ;
34- Benchmark . options . onAbort = event => {
35- console . error ( event ) ;
36- } ;
37- Benchmark . options . onError = event => {
38- console . error ( event ) ;
39- } ;
40-
4115const currentClient = require ( '..' ) ;
42- const benchmarks = createRegressionBenchmark (
43- { name : 'prom-client@current' , module : currentClient } ,
44- [ 'prom-client@latest' ] ,
45- ) ;
16+ const benchmarks = new Benchmark ( {
17+ 'prom-client@latest' : 'prom-client@latest' ,
18+ 'prom-client@trunk' : 'git@github.com:siimon/prom-client' ,
19+ 'prom-client@current' : currentClient ,
20+ } ) ;
4621
4722benchmarks . suite ( 'counter' , require ( './counter' ) ) ;
4823benchmarks . suite ( 'gauge' , require ( './gauge' ) ) ;
4924benchmarks . suite ( 'histogram' , require ( './histogram' ) ) ;
50- benchmarks . suite ( 'summary' , require ( './summary' ) ) ;
5125benchmarks . suite ( 'util' , require ( './util' ) ) ;
26+ benchmarks . suite ( 'summary' , require ( './summary' ) ) ;
5227benchmarks . suite ( 'registry' , require ( './registry' ) ) ;
5328benchmarks . suite ( 'cluster' , require ( './cluster' ) ) ;
5429
0 commit comments