Skip to content

Commit d6d264c

Browse files
authored
Merge pull request #1436 from dirtydiesel46/patch-1
Update Custom Metrics / Performance Measure with Trend param isTime == true
2 parents 8366244 + 6349d80 commit d6d264c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/sources/next/using-k6-browser/metrics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const options = {
124124
},
125125
};
126126
127-
const myTrend = new Trend('total_action_time');
127+
const myTrend = new Trend('total_action_time',true);
128128
129129
export default async function () {
130130
const page = browser.newPage();
@@ -152,7 +152,7 @@ export default async function () {
152152
JSON.parse(JSON.stringify(window.performance.getEntriesByName('total-action-time')))[0].duration
153153
);
154154
155-
myTrend.add(total_action_time);
155+
myTrend.add(totalActionTime);
156156
} finally {
157157
page.close();
158158
}
@@ -166,5 +166,5 @@ After you run the test, you should see a similar output as the one below.
166166
```bash
167167
iteration_duration..........: avg=1.06s min=1.06s med=1.06s max=1.06s p(90)=1.06s p(95)=1.06s
168168
iterations..................: 1 0.70866/s
169-
total_action_time.............: avg=295.3 min=295.3 med=295.3 max=295.3 p(90)=295.3 p(95)=295.3
169+
total_action_time.............: avg=295.3ms min=295.3ms med=295.3ms max=295.3ms p(90)=295.3ms p(95)=295.3ms
170170
```

docs/sources/v0.47.x/using-k6-browser/metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const options = {
124124
},
125125
};
126126
127-
const myTrend = new Trend('total_action_time');
127+
const myTrend = new Trend('total_action_time',true);
128128
129129
export default async function () {
130130
const page = browser.newPage();
@@ -152,7 +152,7 @@ export default async function () {
152152
JSON.parse(JSON.stringify(window.performance.getEntriesByName('total-action-time')))[0].duration
153153
);
154154
155-
myTrend.add(total_action_time);
155+
myTrend.add(totalActionTime);
156156
} finally {
157157
page.close();
158158
}
@@ -166,5 +166,5 @@ After you run the test, you should see a similar output as the one below.
166166
```bash
167167
iteration_duration..........: avg=1.06s min=1.06s med=1.06s max=1.06s p(90)=1.06s p(95)=1.06s
168168
iterations..................: 1 0.70866/s
169-
total_action_time.............: avg=295.3 min=295.3 med=295.3 max=295.3 p(90)=295.3 p(95)=295.3
170-
```
169+
total_action_time.............: avg=295.3ms min=295.3ms med=295.3ms max=295.3ms p(90)=295.3ms p(95)=295.3ms
170+
```

0 commit comments

Comments
 (0)