Skip to content

Commit

Permalink
feat(tinybench-plugin): add dynamic startInstruments function
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jan 12, 2024
1 parent e0fa17e commit 5c7701a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/tinybench-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
mongoMeasurement,
optimizeFunction,
setupCore,
StartInstrumentsRequestBody,
StartInstrumentsResponse,
teardownCore,
tryIntrospect,
} from "@codspeed/core";
Expand Down Expand Up @@ -101,3 +103,12 @@ function getCallingFile(): string {
}
return path.relative(gitDir, callingFile);
}

/**
* Dynamically starts the CodSpeed instruments.
*/
export async function startInstruments(
body: StartInstrumentsRequestBody
): Promise<StartInstrumentsResponse> {
return await mongoMeasurement.startInstruments(body);
}

0 comments on commit 5c7701a

Please sign in to comment.