Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/buffer/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
} from "./index";
import {
isInteger,
timestampToMicros,

Check failure on line 14 in src/buffer/base.ts

View workflow job for this annotation

GitHub Actions / Build with Node.js 20

'timestampToMicros' is defined but never used

Check failure on line 14 in src/buffer/base.ts

View workflow job for this annotation

GitHub Actions / Build with Node.js latest

'timestampToMicros' is defined but never used
timestampToNanos,
TimestampUnit,
} from "../utils";
Expand Down Expand Up @@ -287,11 +287,11 @@
throw new Error(`Value must be an integer or BigInt, received ${value}`);
}
this.writeColumn(name, value, () => {
const valueMicros = timestampToMicros(BigInt(value), unit);
const valueStr = valueMicros.toString();
const valueNanos = timestampToNanos(BigInt(value), unit);
const valueStr = valueNanos.toString();
this.checkCapacity([valueStr], 1);
this.write(valueStr);
this.write("t");
this.write("n");
});
return this;
}
Expand Down
34 changes: 17 additions & 17 deletions test/sender.buffer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand All @@ -473,7 +473,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000, "ns")
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000t\n",
"tableName boolCol=t,timestampCol=1658484765000000n\n",
);
await sender.close();
});
Expand All @@ -491,7 +491,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000, "us")
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand All @@ -509,7 +509,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000, "ms")
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand All @@ -527,7 +527,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000n)
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand All @@ -545,7 +545,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000000n, "ns")
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand All @@ -563,7 +563,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000n, "us")
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand All @@ -581,7 +581,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000n, "ms")
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n",
);
await sender.close();
});
Expand Down Expand Up @@ -619,7 +619,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.at(1658484769000000, "us");
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t 1658484769000000000\n",
"tableName boolCol=t,timestampCol=1658484765000000000n 1658484769000000000\n",
);
await sender.close();
});
Expand All @@ -637,7 +637,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.at(1658484769000, "ms");
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t 1658484769000000000\n",
"tableName boolCol=t,timestampCol=1658484765000000000n 1658484769000000000\n",
);
await sender.close();
});
Expand All @@ -655,7 +655,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.at(1658484769000000n);
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t 1658484769000000000\n",
"tableName boolCol=t,timestampCol=1658484765000000000n 1658484769000000000\n",
);
await sender.close();
});
Expand All @@ -673,7 +673,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.at(1658484769000000123n, "ns");
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t 1658484769000000123\n",
"tableName boolCol=t,timestampCol=1658484765000000000n 1658484769000000123\n",
);
await sender.close();
});
Expand All @@ -691,7 +691,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.at(1658484769000000n, "us");
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t 1658484769000000000\n",
"tableName boolCol=t,timestampCol=1658484765000000000n 1658484769000000000\n",
);
await sender.close();
});
Expand All @@ -709,7 +709,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484765000000)
.at(1658484769000n, "ms");
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t 1658484769000000000\n",
"tableName boolCol=t,timestampCol=1658484765000000000n 1658484769000000000\n",
);
await sender.close();
});
Expand Down Expand Up @@ -1124,8 +1124,8 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484766000000)
.atNow();
expect(bufferContent(sender)).toBe(
"tableName boolCol=t,timestampCol=1658484765000000t\n" +
"tableName boolCol=f,timestampCol=1658484766000000t\n",
"tableName boolCol=t,timestampCol=1658484765000000000n\n" +
"tableName boolCol=f,timestampCol=1658484766000000000n\n",
);

sender.reset();
Expand All @@ -1135,7 +1135,7 @@ describe("Sender message builder test suite (anything not covered in client inte
.timestampColumn("timestampCol", 1658484767000000)
.atNow();
expect(bufferContent(sender)).toBe(
"tableName floatCol=1234567890,timestampCol=1658484767000000t\n",
"tableName floatCol=1234567890,timestampCol=1658484767000000000n\n",
);
await sender.close();
});
Expand Down
Loading