Skip to content

Commit

Permalink
Fix io.time tap.
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 2, 2024
1 parent 0308af3 commit c04425b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/metrics/pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class PipelineMetrics {
const self = this;
self.startStep(step);
return Promise.resolve(p()) // now start the promise
.tap(self.endStep(step));
.tap(() => self.endStep(step));
}
}

Expand Down
38 changes: 19 additions & 19 deletions test/unit/metrics/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,24 +182,24 @@ describe('metrics/index.js', () => {
count: 3,
},
'p1|save|stream.pipeline.io.wait.time': {
average: 22,
min: 18,
average: 20,
min: 14,
max: 26,
sum: 66,
sum: 60,
count: 3,
},
'p1|save|stream.pipeline.io.time': {
average: 2,
min: 2,
max: 2,
sum: 6,
average: 8,
min: 8,
max: 8,
sum: 24,
count: 3,
},
'p1|stream.pipeline.time': {
average: 2046,
min: 2044,
max: 2048,
sum: 6138,
average: 2044,
min: 2042,
max: 2046,
sum: 6132,
count: 3,
},
'p2|stream.channel.wait.time': {
Expand All @@ -224,26 +224,26 @@ describe('metrics/index.js', () => {
count: 1,
},
'p2|get|stream.pipeline.io.wait.time': {
average: 8,
min: 8,
max: 8,
sum: 8,
count: 1,
},
'p2|get|stream.pipeline.io.time': {
average: 14,
min: 14,
max: 14,
sum: 14,
count: 1,
},
'p2|get|stream.pipeline.io.time': {
'p2|publish|stream.pipeline.io.wait.time': {
average: 2,
min: 2,
max: 2,
sum: 2,
count: 1,
},
'p2|publish|stream.pipeline.io.wait.time': {
average: 8,
min: 8,
max: 8,
sum: 8,
count: 1,
},
'p2|publish|stream.pipeline.io.time': {
average: 2,
min: 2,
Expand Down

0 comments on commit c04425b

Please sign in to comment.