Skip to content

Commit

Permalink
chore: remove export of mongoMeasurement - DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jan 17, 2024
1 parent 382f368 commit ae61897
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 42 deletions.
24 changes: 12 additions & 12 deletions packages/benchmark.js-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
Measurement,
mongoMeasurement,
// mongoMeasurement,
optimizeFunction,
optimizeFunctionSync,
setupCore,
SetupInstrumentsRequestBody,
SetupInstrumentsResponse,
// SetupInstrumentsRequestBody,
// SetupInstrumentsResponse,
teardownCore,
tryIntrospect,
} from "@codspeed/core";
Expand Down Expand Up @@ -227,14 +227,14 @@ async function runBenchmarks({
/**
* Dynamically setup the CodSpeed instruments.
*/
export async function setupInstruments(
body: SetupInstrumentsRequestBody
): Promise<SetupInstrumentsResponse> {
if (!Measurement.isInstrumented()) {
console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");
// export async function setupInstruments(
// body: SetupInstrumentsRequestBody
// ): Promise<SetupInstrumentsResponse> {
// if (!Measurement.isInstrumented()) {
// console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");

return { remoteAddr: body.mongoUrl };
}
// return { remoteAddr: body.mongoUrl };
// }

return await mongoMeasurement.setupInstruments(body);
}
// return await mongoMeasurement.setupInstruments(body);
// }
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkV8Flags } from "./introspection";
import { MongoMeasurement } from "./mongoMeasurement";
// import { MongoMeasurement } from "./mongoMeasurement";
import native_core from "./native_core";
import { initOptimization } from "./optimization";

Expand All @@ -9,7 +9,7 @@ const linuxPerf = new native_core.LinuxPerf();

export const isBound = native_core.isBound;

export const mongoMeasurement = new MongoMeasurement();
// export const mongoMeasurement = new MongoMeasurement();

export const setupCore = () => {
initOptimization();
Expand Down
24 changes: 12 additions & 12 deletions packages/tinybench-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
getGitDir,
Measurement,
mongoMeasurement,
// mongoMeasurement,
optimizeFunction,
setupCore,
SetupInstrumentsRequestBody,
SetupInstrumentsResponse,
// SetupInstrumentsRequestBody,
// SetupInstrumentsResponse,
teardownCore,
tryIntrospect,
} from "@codspeed/core";
Expand Down Expand Up @@ -107,14 +107,14 @@ function getCallingFile(): string {
/**
* Dynamically setup the CodSpeed instruments.
*/
export async function setupInstruments(
body: SetupInstrumentsRequestBody
): Promise<SetupInstrumentsResponse> {
if (!Measurement.isInstrumented()) {
console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");
// export async function setupInstruments(
// body: SetupInstrumentsRequestBody
// ): Promise<SetupInstrumentsResponse> {
// if (!Measurement.isInstrumented()) {
// console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");

return { remoteAddr: body.mongoUrl };
}
// return { remoteAddr: body.mongoUrl };
// }

return await mongoMeasurement.setupInstruments(body);
}
// return await mongoMeasurement.setupInstruments(body);
// }
26 changes: 10 additions & 16 deletions packages/vitest-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
getV8Flags,
Measurement,
mongoMeasurement,
SetupInstrumentsRequestBody,
SetupInstrumentsResponse,
} from "@codspeed/core";
import { getV8Flags, Measurement } from "@codspeed/core";
import { join } from "path";
import { Plugin } from "vite";
import { UserConfig } from "vitest/config";
Expand Down Expand Up @@ -55,14 +49,14 @@ export default function codspeedPlugin(): Plugin {
/**
* Dynamically setup the CodSpeed instruments.
*/
export async function setupInstruments(
body: SetupInstrumentsRequestBody
): Promise<SetupInstrumentsResponse> {
if (!Measurement.isInstrumented()) {
console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");
// export async function setupInstruments(
// body: SetupInstrumentsRequestBody
// ): Promise<SetupInstrumentsResponse> {
// if (!Measurement.isInstrumented()) {
// console.warn("[CodSpeed] No instrumentation found, using default mongoUrl");

return { remoteAddr: body.mongoUrl };
}
// return { remoteAddr: body.mongoUrl };
// }

return await mongoMeasurement.setupInstruments(body);
}
// return await mongoMeasurement.setupInstruments(body);
// }

0 comments on commit ae61897

Please sign in to comment.