Skip to content

Commit bce195c

Browse files
committed
fixup: instrument-hooks
1 parent fb7928e commit bce195c

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export type {
6868
SetupInstrumentsRequestBody,
6969
SetupInstrumentsResponse,
7070
} from "./generated/openapi";
71-
export type { BuildMode };
7271
export { getV8Flags, tryIntrospect } from "./introspection";
7372
export { optimizeFunction, optimizeFunctionSync } from "./optimization";
7473
export * from "./utils";
7574
export * from "./walltime";
75+
export type { BuildMode };
7676
export const InstrumentHooks = native_core.InstrumentHooks;
Submodule hooks updated from 69b88f7 to 89fb72a

packages/tinybench-plugin/src/analysis.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
getCodspeedRunnerMode,
23
InstrumentHooks,
34
mongoMeasurement,
45
optimizeFunction,
@@ -16,7 +17,8 @@ export function setupCodspeedAnalysisBench(
1617

1718
class AnalysisBenchRunner extends BaseBenchRunner {
1819
protected getModeName(): string {
19-
return "analysis mode";
20+
const runnerMode = getCodspeedRunnerMode();
21+
return `${runnerMode} mode`;
2022
}
2123

2224
private taskCompletionMessage() {

packages/vitest-plugin/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ export default function codspeedPlugin(): Plugin {
3737
if (mode !== "benchmark") {
3838
return false;
3939
}
40-
if (
41-
getBuildMode() == "analysis" &&
42-
!InstrumentHooks.isInstrumented()
43-
) {
40+
if (getBuildMode() == "analysis" && !InstrumentHooks.isInstrumented()) {
4441
console.warn("[CodSpeed] bench detected but no instrumentation found");
4542
}
4643
return true;

0 commit comments

Comments
 (0)