Skip to content

Commit 75d1a6f

Browse files
authored
feat: For application latencies timed stream a few cosmetic changes are needed (#1645)
## Description The comments in [this discussion](https://togithub.com/googleapis/nodejs-bigtable/pull/1639#pullrequestreview-3044883797) should be addressed in this PR. ## Impact Makes code cleaner. ## Testing This is just a follow-up on a PR.
1 parent 7bc77ca commit 75d1a6f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/timed-stream.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ type TimedStreamOptions = TransformOptions & {
2929
) => void;
3030
};
3131

32+
/**
33+
* StreamTimer is a utility class for measuring the elapsed time of stream
34+
* operations. It provides methods to start and stop the timer, as well as
35+
* retrieve the total duration in milliseconds.
36+
*/
3237
class StreamTimer {
3338
private startTime;
3439
private totalDuration;
@@ -62,7 +67,6 @@ export class TimedStream extends PassThrough {
6267
private readTimer = new StreamTimer();
6368
private transformTimer = new StreamTimer();
6469
constructor(options?: TimedStreamOptions) {
65-
// highWaterMark of 1 is needed to respond to each row
6670
super({
6771
...options,
6872
objectMode: true,

0 commit comments

Comments
 (0)