From c9ba8a5fb95a645978f6b85cc3c775d633364262 Mon Sep 17 00:00:00 2001 From: Fabian Jucker Date: Mon, 22 Jun 2026 07:09:19 +0000 Subject: [PATCH] Reduce CloudFetch metric logging verbosity from INFO to DEBUG (fixes #311)\n\n- Change log level to DEBUG for cloud fetch speed metrics\n- Add unit test asserting debug-level logging Signed-off-by: Fabian Jucker --- lib/result/CloudFetchResultHandler.ts | 2 +- .../result/CloudFetchResultHandler.test.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/result/CloudFetchResultHandler.ts b/lib/result/CloudFetchResultHandler.ts index 76f958b5..b9e89312 100644 --- a/lib/result/CloudFetchResultHandler.ts +++ b/lib/result/CloudFetchResultHandler.ts @@ -103,7 +103,7 @@ export default class CloudFetchResultHandler implements IResultsProvider { expect(context.invokeWithRetryStub.called).to.be.false; }); + it('should log cloud fetch download speed at debug level', async () => { + const context = new ClientContextStub({ cloudFetchConcurrentDownloads: 1 }); + const rowSetProvider = new ResultsProviderStub([sampleRowSet1], undefined); + const result = new CloudFetchResultHandler(context, rowSetProvider, { + status: { statusCode: TStatusCode.SUCCESS_STATUS }, + }); + + const logStub = sinon.stub(context.logger, 'log'); + context.invokeWithRetryStub.callsFake(async () => ({ + request: new Request('localhost'), + response: new Response(Buffer.concat([sampleArrowSchema, sampleArrowBatch]), { status: 200 }), + })); + + await result.fetchNext({ limit: 10000 }); + + expect(logStub.calledWith(LogLevel.debug, sinon.match(/Result File Download speed from cloud storage/))).to.be.true; + expect(logStub.neverCalledWith(LogLevel.info, sinon.match(/Result File Download speed from cloud storage/))).to.be + .true; + }); + it('should download batches according to settings', async () => { const context = new ClientContextStub({ cloudFetchConcurrentDownloads: 3 }); const clientConfig = context.getConfig();