diff --git a/test/benchmark/http/server.js b/test/benchmark/http/server.bench.js similarity index 100% rename from test/benchmark/http/server.js rename to test/benchmark/http/server.bench.js diff --git a/test/benchmark/shimmer/instrumentation.bench.js b/test/benchmark/shimmer/instrumentation.bench.js index dd81b06a74..a7e090c9d0 100644 --- a/test/benchmark/shimmer/instrumentation.bench.js +++ b/test/benchmark/shimmer/instrumentation.bench.js @@ -11,17 +11,17 @@ const shimmer = require('../../../lib/shimmer') const suite = benchmark.createBenchmark({ name: 'shimmer wrapping', delay: 0.01 }) suite.add({ - name: 'shimmer.patchModule()', + name: 'shimmer.registerHooks()', agent: true, fn: function (agent) { - return shimmer.patchModule(agent) + return shimmer.registerHooks(agent) } }) suite.add({ - name: 'shimmer.unpatchModule()', + name: 'shimmer.removeHooks()', fn: function () { - return shimmer.unpatchModule() + return shimmer.removeHooks() } }) diff --git a/test/lib/benchmark.js b/test/lib/benchmark.js index 952a4e6d97..4c6e69e544 100644 --- a/test/lib/benchmark.js +++ b/test/lib/benchmark.js @@ -35,7 +35,7 @@ class Benchmark { const samples = this.samples return (this.processedSamples = Object.keys(samples).reduce((acc, sampleName) => { try { - acc[sampleName] = new BenchmarkStats(samples[sampleName]) + acc[sampleName] = new BenchmarkStats(samples[sampleName], this.name, sampleName) return acc } catch (e) { /* eslint-disable no-console */ @@ -152,9 +152,10 @@ class Benchmark { } class BenchmarkStats { - constructor(samples) { + constructor(samples, testName, sampleName) { if (samples.length < 1) { - throw new Error('BenchmarkStats requires additional samples') + console.log(`BenchmarkStats for ${testName} has no samples. SampleName: ${sampleName}`) + throw new Error('BenchmarkStats requires more than zero samples') } let sortedSamples = samples.slice().sort((a, b) => a - b)