Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
958 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | const _1 = require(".");
|
---|
| 4 | describe("Logs", () => {
|
---|
| 5 | it("should give same result after been written then read", () => {
|
---|
| 6 | // given
|
---|
| 7 | let buffer = "";
|
---|
| 8 | const writer = new _1.HistogramLogWriter((content) => {
|
---|
| 9 | buffer += content;
|
---|
| 10 | });
|
---|
| 11 | writer.outputLogFormatVersion();
|
---|
| 12 | writer.outputStartTime(12345000);
|
---|
| 13 | writer.outputLegend();
|
---|
| 14 | const inputHistogram = _1.build();
|
---|
| 15 | inputHistogram.recordValue(42);
|
---|
| 16 | // when
|
---|
| 17 | writer.outputIntervalHistogram(inputHistogram, 12345042, 1234056, 1);
|
---|
| 18 | const reader = new _1.HistogramLogReader(buffer);
|
---|
| 19 | const outputHistogram = reader.nextIntervalHistogram();
|
---|
| 20 | // then
|
---|
| 21 | expect(outputHistogram).not.toBeNull();
|
---|
| 22 | // @ts-ignore
|
---|
| 23 | expect(outputHistogram.mean).toBe(inputHistogram.mean);
|
---|
| 24 | });
|
---|
| 25 | });
|
---|
| 26 | //# sourceMappingURL=log.spec.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.