@codspeed/tinybench-plugin 2.3.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,11 +12,11 @@ tinybench compatibility layer for CodSpeed
12
12
 
13
13
  ## Documentation
14
14
 
15
- Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs) for complete integration instructions.
15
+ Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs/tinybench) for complete integration instructions.
16
16
 
17
17
  ## Installation
18
18
 
19
- First install the plugin [`@codspeed/tinybench-plugin`](https://www.npmjs.com/package/@codspeed/tinybench-plugin) and `tinybench` (if not already installed):
19
+ First, install the plugin [`@codspeed/tinybench-plugin`](https://www.npmjs.com/package/@codspeed/tinybench-plugin) and `tinybench` (if not already installed):
20
20
 
21
21
  ```sh
22
22
  npm install --save-dev @codspeed/tinybench-plugin tinybench
@@ -87,4 +87,4 @@ $ node benches/bench.mjs
87
87
 
88
88
  And... Congrats🎉, CodSpeed is installed in your benchmarking suite! Locally, CodSpeed will fallback to tinybench since the instrumentation is only available in the CI environment for now.
89
89
 
90
- You can now [run those benchmark in your CI](https://docs.codspeed.io/benchmarks/nodejs#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements.
90
+ You can now [run those benchmarks in your CI](https://docs.codspeed.io/benchmarks/nodejs/tinybench#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements.
package/dist/index.cjs.js CHANGED
@@ -86,7 +86,7 @@ function withCodSpeed(bench) {
86
86
  };
87
87
  const rootCallingFile = getCallingFile();
88
88
  bench.run = async () => {
89
- console.log(`[CodSpeed] running with @codspeed/tinybench v${"2.3.1"}`);
89
+ console.log(`[CodSpeed] running with @codspeed/tinybench v${"3.1.0"}`);
90
90
  core.setupCore();
91
91
  for (const task of bench.tasks) {
92
92
  const uri = isCodSpeedBenchOptions(task.opts) ? task.opts.uri : `${rootCallingFile}::${task.name}`;
@@ -97,11 +97,13 @@ function withCodSpeed(bench) {
97
97
  await task.opts.afterEach?.call(task);
98
98
  });
99
99
  await task.opts.beforeEach?.call(task);
100
+ await core.mongoMeasurement.start(uri);
100
101
  await async function __codspeed_root_frame__() {
101
102
  core.Measurement.startInstrumentation();
102
103
  await task.fn();
103
104
  core.Measurement.stopInstrumentation(uri);
104
105
  }();
106
+ await core.mongoMeasurement.stop(uri);
105
107
  await task.opts.afterEach?.call(task);
106
108
  await task.opts.afterAll?.call(task);
107
109
  console.log(` \u2714 Measured ${uri}`);
@@ -124,6 +126,14 @@ function getCallingFile() {
124
126
  }
125
127
  return path.relative(gitDir, callingFile);
126
128
  }
129
+ async function setupInstruments(body) {
130
+ if (!core.Measurement.isInstrumented()) {
131
+ console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");
132
+ return { remoteAddr: body.mongoUrl };
133
+ }
134
+ return await core.mongoMeasurement.setupInstruments(body);
135
+ }
127
136
 
137
+ exports.setupInstruments = setupInstruments;
128
138
  exports.withCodSpeed = withCodSpeed;
129
139
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/stack-trace@1.0.0-pre2/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import {\n getGitDir,\n Measurement,\n optimizeFunction,\n setupCore,\n teardownCore,\n tryIntrospect,\n} from \"@codspeed/core\";\nimport path from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench, Task } from \"tinybench\";\nimport { fileURLToPath } from \"url\";\n\ndeclare const __VERSION__: string;\n\ntryIntrospect();\n\ntype CodSpeedBenchOptions = Task[\"opts\"] & {\n uri: string;\n};\n\nfunction isCodSpeedBenchOptions(\n options: Task[\"opts\"]\n): options is CodSpeedBenchOptions {\n return \"uri\" in options;\n}\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!Measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n\n const rawAdd = bench.add;\n bench.add = (name, fn, opts: CodSpeedBenchOptions) => {\n const callingFile = getCallingFile();\n const uri = `${callingFile}::${name}`;\n const options = Object.assign({}, opts ?? {}, { uri });\n return rawAdd.bind(bench)(name, fn, options);\n };\n const rootCallingFile = getCallingFile();\n\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n setupCore();\n for (const task of bench.tasks) {\n const uri = isCodSpeedBenchOptions(task.opts)\n ? task.opts.uri\n : `${rootCallingFile}::${task.name}`;\n\n await task.opts.beforeAll?.call(task);\n\n // run optimizations\n await optimizeFunction(async () => {\n await task.opts.beforeEach?.call(task);\n await task.fn();\n await task.opts.afterEach?.call(task);\n });\n\n // run instrumented benchmark\n await task.opts.beforeEach?.call(task);\n await (async function __codspeed_root_frame__() {\n Measurement.startInstrumentation();\n await task.fn();\n Measurement.stopInstrumentation(uri);\n })();\n await task.opts.afterEach?.call(task);\n\n await task.opts.afterAll?.call(task);\n\n // print results\n console.log(` ✔ Measured ${uri}`);\n }\n teardownCore();\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n let callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n if (callingFile.startsWith(\"file://\")) {\n callingFile = fileURLToPath(callingFile);\n }\n return path.relative(gitDir, callingFile);\n}\n"],"names":["tryIntrospect","Measurement","setupCore","optimizeFunction","teardownCore","getStackTrace","getGitDir","fileURLToPath"],"mappings":";;;;;;AAAO,SAAS,GAAG,CAAC,OAAO,EAAE;AAC7B,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;AACzC,EAAE,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AACnC;AACA,EAAE,MAAM,WAAW,GAAG,EAAE,CAAC;AACzB;AACA,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC;AAC5C,EAAE,KAAK,CAAC,iBAAiB,GAAG,SAAS,WAAW,EAAE,YAAY,EAAE;AAChE,IAAI,OAAO,YAAY,CAAC;AACxB,GAAG,CAAC;AACJ,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC;AACvD;AACA,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC;AACzC,EAAE,KAAK,CAAC,iBAAiB,GAAG,SAAS,CAAC;AACtC,EAAE,KAAK,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CAAQ,GAAI,CAAA,CAAA,wBAAA,EAA2B,KAAM,CAAA,KAAA,CAAM,MAAiB,CAAA,SAAA,CAAA,CAAA,CAAA;AACpE,IAAA,OAAO,KAAM,CAAA,KAAA,CAAA;AAAA,GACf,CAAA;AACA,EAAO,OAAA,KAAA,CAAA;AACT,CAAA;AAEA,SAAS,cAAyB,GAAA;AAChC,EAAA,MAAM,QAAQC,GAAc,EAAA,CAAA;AAC5B,EAAA,IAAI,WAAc,GAAA,KAAA,CAAM,CAAC,CAAA,CAAE,WAAY,EAAA,CAAA;AACvC,EAAM,MAAA,MAAA,GAASC,eAAU,WAAW,CAAA,CAAA;AACpC,EAAA,IAAI,WAAW,KAAW,CAAA,EAAA;AACxB,IAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAAA;AAAA,GACnD;AACA,EAAI,IAAA,WAAA,CAAY,UAAW,CAAA,SAAS,CAAG,EAAA;AACrC,IAAA,WAAA,GAAcC,kBAAc,WAAW,CAAA,CAAA;AAAA,GACzC;AACA,EAAO,OAAA,IAAA,CAAK,QAAS,CAAA,MAAA,EAAQ,WAAW,CAAA,CAAA;AAC1C;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/stack-trace@1.0.0-pre2/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import {\n getGitDir,\n Measurement,\n mongoMeasurement,\n optimizeFunction,\n setupCore,\n SetupInstrumentsRequestBody,\n SetupInstrumentsResponse,\n teardownCore,\n tryIntrospect,\n} from \"@codspeed/core\";\nimport path from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench, Task } from \"tinybench\";\nimport { fileURLToPath } from \"url\";\n\ndeclare const __VERSION__: string;\n\ntryIntrospect();\n\ntype CodSpeedBenchOptions = Task[\"opts\"] & {\n uri: string;\n};\n\nfunction isCodSpeedBenchOptions(\n options: Task[\"opts\"]\n): options is CodSpeedBenchOptions {\n return \"uri\" in options;\n}\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!Measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n\n const rawAdd = bench.add;\n bench.add = (name, fn, opts: CodSpeedBenchOptions) => {\n const callingFile = getCallingFile();\n const uri = `${callingFile}::${name}`;\n const options = Object.assign({}, opts ?? {}, { uri });\n return rawAdd.bind(bench)(name, fn, options);\n };\n const rootCallingFile = getCallingFile();\n\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n setupCore();\n for (const task of bench.tasks) {\n const uri = isCodSpeedBenchOptions(task.opts)\n ? task.opts.uri\n : `${rootCallingFile}::${task.name}`;\n\n await task.opts.beforeAll?.call(task);\n\n // run optimizations\n await optimizeFunction(async () => {\n await task.opts.beforeEach?.call(task);\n await task.fn();\n await task.opts.afterEach?.call(task);\n });\n\n // run instrumented benchmark\n await task.opts.beforeEach?.call(task);\n\n await mongoMeasurement.start(uri);\n await (async function __codspeed_root_frame__() {\n Measurement.startInstrumentation();\n await task.fn();\n Measurement.stopInstrumentation(uri);\n })();\n await mongoMeasurement.stop(uri);\n\n await task.opts.afterEach?.call(task);\n\n await task.opts.afterAll?.call(task);\n\n // print results\n console.log(` ✔ Measured ${uri}`);\n }\n teardownCore();\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n let callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n if (callingFile.startsWith(\"file://\")) {\n callingFile = fileURLToPath(callingFile);\n }\n return path.relative(gitDir, callingFile);\n}\n\n/**\n * Dynamically setup the CodSpeed instruments.\n */\nexport async function setupInstruments(\n body: SetupInstrumentsRequestBody\n): Promise<SetupInstrumentsResponse> {\n if (!Measurement.isInstrumented()) {\n console.warn(\"[CodSpeed] No instrumentation found, using default mongoUrl\");\n\n return { remoteAddr: body.mongoUrl };\n }\n\n return await mongoMeasurement.setupInstruments(body);\n}\n"],"names":["tryIntrospect","Measurement","setupCore","optimizeFunction","mongoMeasurement","teardownCore","getStackTrace","getGitDir","fileURLToPath"],"mappings":";;;;;;AAAO,SAAS,GAAG,CAAC,OAAO,EAAE;AAC7B,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;AACzC,EAAE,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AACnC;AACA,EAAE,MAAM,WAAW,GAAG,EAAE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AAsB,iBACpB,IACmC,EAAA;AACnC,EAAI,IAAA,CAACP,gBAAY,CAAA,cAAA,EAAkB,EAAA;AACjC,IAAA,OAAA,CAAQ,KAAK,6DAA6D,CAAA,CAAA;AAE1E,IAAO,OAAA,EAAE,UAAY,EAAA,IAAA,CAAK,QAAS,EAAA,CAAA;AAAA,GACrC;AAEA,EAAO,OAAA,MAAMG,qBAAiB,CAAA,gBAAA,CAAiB,IAAI,CAAA,CAAA;AACrD;;;;;","x_google_ignoreList":[0]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,11 @@
1
+ import { SetupInstrumentsRequestBody, SetupInstrumentsResponse } from '@codspeed/core';
1
2
  import { Bench } from 'tinybench';
2
3
 
3
4
  declare function withCodSpeed(bench: Bench): Bench;
5
+ /**
6
+ * Dynamically setup the CodSpeed instruments.
7
+ */
8
+ declare function setupInstruments(body: SetupInstrumentsRequestBody): Promise<SetupInstrumentsResponse>;
4
9
 
5
- export { withCodSpeed };
10
+ export { setupInstruments, withCodSpeed };
6
11
  //# sourceMappingURL=index.d.ts.map
package/dist/index.es5.js CHANGED
@@ -1,4 +1,4 @@
1
- import { tryIntrospect, Measurement, setupCore, optimizeFunction, teardownCore, getGitDir } from '@codspeed/core';
1
+ import { tryIntrospect, Measurement, setupCore, optimizeFunction, mongoMeasurement, teardownCore, getGitDir } from '@codspeed/core';
2
2
  import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
4
 
@@ -84,7 +84,7 @@ function withCodSpeed(bench) {
84
84
  };
85
85
  const rootCallingFile = getCallingFile();
86
86
  bench.run = async () => {
87
- console.log(`[CodSpeed] running with @codspeed/tinybench v${"2.3.1"}`);
87
+ console.log(`[CodSpeed] running with @codspeed/tinybench v${"3.1.0"}`);
88
88
  setupCore();
89
89
  for (const task of bench.tasks) {
90
90
  const uri = isCodSpeedBenchOptions(task.opts) ? task.opts.uri : `${rootCallingFile}::${task.name}`;
@@ -95,11 +95,13 @@ function withCodSpeed(bench) {
95
95
  await task.opts.afterEach?.call(task);
96
96
  });
97
97
  await task.opts.beforeEach?.call(task);
98
+ await mongoMeasurement.start(uri);
98
99
  await async function __codspeed_root_frame__() {
99
100
  Measurement.startInstrumentation();
100
101
  await task.fn();
101
102
  Measurement.stopInstrumentation(uri);
102
103
  }();
104
+ await mongoMeasurement.stop(uri);
103
105
  await task.opts.afterEach?.call(task);
104
106
  await task.opts.afterAll?.call(task);
105
107
  console.log(` \u2714 Measured ${uri}`);
@@ -122,6 +124,13 @@ function getCallingFile() {
122
124
  }
123
125
  return path.relative(gitDir, callingFile);
124
126
  }
127
+ async function setupInstruments(body) {
128
+ if (!Measurement.isInstrumented()) {
129
+ console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");
130
+ return { remoteAddr: body.mongoUrl };
131
+ }
132
+ return await mongoMeasurement.setupInstruments(body);
133
+ }
125
134
 
126
- export { withCodSpeed };
135
+ export { setupInstruments, withCodSpeed };
127
136
  //# sourceMappingURL=index.es5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es5.js","sources":["../../../node_modules/.pnpm/stack-trace@1.0.0-pre2/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import {\n getGitDir,\n Measurement,\n optimizeFunction,\n setupCore,\n teardownCore,\n tryIntrospect,\n} from \"@codspeed/core\";\nimport path from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench, Task } from \"tinybench\";\nimport { fileURLToPath } from \"url\";\n\ndeclare const __VERSION__: string;\n\ntryIntrospect();\n\ntype CodSpeedBenchOptions = Task[\"opts\"] & {\n uri: string;\n};\n\nfunction isCodSpeedBenchOptions(\n options: Task[\"opts\"]\n): options is CodSpeedBenchOptions {\n return \"uri\" in options;\n}\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!Measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n\n const rawAdd = bench.add;\n bench.add = (name, fn, opts: CodSpeedBenchOptions) => {\n const callingFile = getCallingFile();\n const uri = `${callingFile}::${name}`;\n const options = Object.assign({}, opts ?? {}, { uri });\n return rawAdd.bind(bench)(name, fn, options);\n };\n const rootCallingFile = getCallingFile();\n\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n setupCore();\n for (const task of bench.tasks) {\n const uri = isCodSpeedBenchOptions(task.opts)\n ? task.opts.uri\n : `${rootCallingFile}::${task.name}`;\n\n await task.opts.beforeAll?.call(task);\n\n // run optimizations\n await optimizeFunction(async () => {\n await task.opts.beforeEach?.call(task);\n await task.fn();\n await task.opts.afterEach?.call(task);\n });\n\n // run instrumented benchmark\n await task.opts.beforeEach?.call(task);\n await (async function __codspeed_root_frame__() {\n Measurement.startInstrumentation();\n await task.fn();\n Measurement.stopInstrumentation(uri);\n })();\n await task.opts.afterEach?.call(task);\n\n await task.opts.afterAll?.call(task);\n\n // print results\n console.log(` ✔ Measured ${uri}`);\n }\n teardownCore();\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n let callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n if (callingFile.startsWith(\"file://\")) {\n callingFile = fileURLToPath(callingFile);\n }\n return path.relative(gitDir, callingFile);\n}\n"],"names":["getStackTrace"],"mappings":";;;;AAAO,SAAS,GAAG,CAAC,OAAO,EAAE;AAC7B,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;AACzC,EAAE,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AACnC;AACA,EAAE,MAAM,WAAW,GAAG,EAAE,CAAC;AACzB;AACA,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC;AAC5C,EAAE,KAAK,CAAC,iBAAiB,GAAG,SAAS,WAAW,EAAE,YAAY,EAAE;AAChE,IAAI,OAAO,YAAY,CAAC;AACxB,GAAG,CAAC;AACJ,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC;AACvD;AACA,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC;AACzC,EAAE,KAAK,CAAC,iBAAiB,GAAG,SAAS,CAAC;AACtC,EAAE,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AACnC;AACA,EAAE,OAAO,YAAY,CAAC;AACtB,CAAC;AA4ED;AACA,SAAS,QAAQ,CAAC,UAAU,E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,KAAA,CAAA;AAAA,GACf,CAAA;AACA,EAAO,OAAA,KAAA,CAAA;AACT,CAAA;AAEA,SAAS,cAAyB,GAAA;AAChC,EAAA,MAAM,QAAQA,GAAc,EAAA,CAAA;AAC5B,EAAA,IAAI,WAAc,GAAA,KAAA,CAAM,CAAC,CAAA,CAAE,WAAY,EAAA,CAAA;AACvC,EAAM,MAAA,MAAA,GAAS,UAAU,WAAW,CAAA,CAAA;AACpC,EAAA,IAAI,WAAW,KAAW,CAAA,EAAA;AACxB,IAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAAA;AAAA,GACnD;AACA,EAAI,IAAA,WAAA,CAAY,UAAW,CAAA,SAAS,CAAG,EAAA;AACrC,IAAA,WAAA,GAAc,cAAc,WAAW,CAAA,CAAA;AAAA,GACzC;AACA,EAAO,OAAA,IAAA,CAAK,QAAS,CAAA,MAAA,EAAQ,WAAW,CAAA,CAAA;AAC1C;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es5.js","sources":["../../../node_modules/.pnpm/stack-trace@1.0.0-pre2/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import {\n getGitDir,\n Measurement,\n mongoMeasurement,\n optimizeFunction,\n setupCore,\n SetupInstrumentsRequestBody,\n SetupInstrumentsResponse,\n teardownCore,\n tryIntrospect,\n} from \"@codspeed/core\";\nimport path from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench, Task } from \"tinybench\";\nimport { fileURLToPath } from \"url\";\n\ndeclare const __VERSION__: string;\n\ntryIntrospect();\n\ntype CodSpeedBenchOptions = Task[\"opts\"] & {\n uri: string;\n};\n\nfunction isCodSpeedBenchOptions(\n options: Task[\"opts\"]\n): options is CodSpeedBenchOptions {\n return \"uri\" in options;\n}\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!Measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n\n const rawAdd = bench.add;\n bench.add = (name, fn, opts: CodSpeedBenchOptions) => {\n const callingFile = getCallingFile();\n const uri = `${callingFile}::${name}`;\n const options = Object.assign({}, opts ?? {}, { uri });\n return rawAdd.bind(bench)(name, fn, options);\n };\n const rootCallingFile = getCallingFile();\n\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n setupCore();\n for (const task of bench.tasks) {\n const uri = isCodSpeedBenchOptions(task.opts)\n ? task.opts.uri\n : `${rootCallingFile}::${task.name}`;\n\n await task.opts.beforeAll?.call(task);\n\n // run optimizations\n await optimizeFunction(async () => {\n await task.opts.beforeEach?.call(task);\n await task.fn();\n await task.opts.afterEach?.call(task);\n });\n\n // run instrumented benchmark\n await task.opts.beforeEach?.call(task);\n\n await mongoMeasurement.start(uri);\n await (async function __codspeed_root_frame__() {\n Measurement.startInstrumentation();\n await task.fn();\n Measurement.stopInstrumentation(uri);\n })();\n await mongoMeasurement.stop(uri);\n\n await task.opts.afterEach?.call(task);\n\n await task.opts.afterAll?.call(task);\n\n // print results\n console.log(` ✔ Measured ${uri}`);\n }\n teardownCore();\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n let callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n if (callingFile.startsWith(\"file://\")) {\n callingFile = fileURLToPath(callingFile);\n }\n return path.relative(gitDir, callingFile);\n}\n\n/**\n * Dynamically setup the CodSpeed instruments.\n */\nexport async function setupInstruments(\n body: SetupInstrumentsRequestBody\n): Promise<SetupInstrumentsResponse> {\n if (!Measurement.isInstrumented()) {\n console.warn(\"[CodSpeed] No instrumentation found, using default mongoUrl\");\n\n return { remoteAddr: body.mongoUrl };\n }\n\n return await mongoMeasurement.setupInstruments(body);\n}\n"],"names":["getStackTrace"],"mappings":";;;;AAAO,SAAS,GAAG,CAAC,OAAO,EAAE;AAC7B,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;AACzC,EAAE,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AACnC;AACA,EAAE,MAAM,WAAW,GAAG,EAAE,CAAC;AACzB;AACA,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC;AAC5C,EAAE,KAAK,CAAC,iBAAiB,GAAG,SAAS,WAAW,EAAE,YAAY,EAAE;AAChE,IAAI,OAAO,YAAY,CAAC;AACxB,GAAG,CAAC;AACJ,EAAE,KAA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AO,OAAA,MAAM,gBAAiB,CAAA,gBAAA,CAAiB,IAAI,CAAA,CAAA;AACrD;;;;","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codspeed/tinybench-plugin",
3
- "version": "2.3.1",
3
+ "version": "3.1.0",
4
4
  "description": "tinybench compatibility layer for CodSpeed",
5
5
  "keywords": [
6
6
  "codspeed",
@@ -24,7 +24,7 @@
24
24
  "tinybench": "^2.5.0"
25
25
  },
26
26
  "dependencies": {
27
- "@codspeed/core": "^2.3.1",
27
+ "@codspeed/core": "^3.1.0",
28
28
  "stack-trace": "1.0.0-pre2"
29
29
  },
30
30
  "peerDependencies": {