Skip to content

Commit 8d93fcd

Browse files
committed
Log level and guard against divide by zero
1 parent cbd0bcd commit 8d93fcd

File tree

1 file changed

+2
-2
lines changed
  • internal-packages/clickhouse/src/client

1 file changed

+2
-2
lines changed

internal-packages/clickhouse/src/client/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,11 @@ export class ClickhouseClient implements ClickhouseReader, ClickhouseWriter {
359359

360360
if (typeof summaryHeader === "string") {
361361
const parsedSummary = JSON.parse(summaryHeader);
362-
this.logger.log("parsedSummary", parsedSummary);
362+
this.logger.debug("parsedSummary", parsedSummary);
363363
const readBytes = parsedSummary.read_bytes ? parseInt(parsedSummary.read_bytes, 10) : 0;
364364
const elapsedNs = parsedSummary.elapsed_ns ? parseInt(parsedSummary.elapsed_ns, 10) : 0;
365365
const elapsedSeconds = elapsedNs / 1_000_000_000;
366-
const byteSeconds = readBytes / elapsedSeconds;
366+
const byteSeconds = elapsedSeconds > 0 ? readBytes / elapsedSeconds : 0;
367367
stats = {
368368
read_rows: parsedSummary.read_rows ?? "0",
369369
read_bytes: parsedSummary.read_bytes ?? "0",

0 commit comments

Comments
 (0)