diff --git a/packages/core/src/mongoMeasurement.ts b/packages/core/src/mongoMeasurement.ts index c800bda..f8abc73 100644 --- a/packages/core/src/mongoMeasurement.ts +++ b/packages/core/src/mongoMeasurement.ts @@ -7,25 +7,41 @@ export class MongoMeasurement { const serverUrl = process.env.CODSPEED_MONGO_INSTR_SERVER_ADDRESS; if (serverUrl !== undefined) { + console.log(`[CORE] Connecting to MongoTracer at ${serverUrl}`); this.tracerClient = new MongoTracer({ BASE: serverUrl, }); + console.log(`[CORE] MongoTracer connected`); } } public async start(uri: string) { + console.log(`[CORE] Starting MongoTracer for ${uri}`); if (this.tracerClient !== undefined) { + console.log(`[CORE] MongoTracer started for ${uri}`); await this.tracerClient.instrumentation.start({ uri, }); + console.log(`[CORE] MongoTracer started for ${uri}`); + } else { + console.log( + `[CORE] MongoTracer not started for ${uri}, tracerClient is undefined` + ); } } public async stop(uri: string) { + console.log(`[CORE] Stopping MongoTracer for ${uri}`); if (this.tracerClient !== undefined) { + console.log(`[CORE] MongoTracer stopped for ${uri}`); await this.tracerClient.instrumentation.stop({ uri, }); + console.log(`[CORE] MongoTracer stopped for ${uri}`); + } else { + console.log( + `[CORE] MongoTracer not stopped for ${uri}, tracerClient is undefined` + ); } } }