Skip to content

Commit 8d04561

Browse files
update naming on trends variables to use underscore
CLI warning for name deprecation
1 parent cbca938 commit 8d04561

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/data/markdown/docs/05 Examples/02 Tutorials/01 Get started with k6/300 Analyze results.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ import { Trend } from "k6/metrics";
288288
const baseUrl = "https://test.k6.io";
289289
290290
// Create custom trend metrics
291-
const contactsLatency = new Trend("contacts duration");
292-
const coinflipLatency = new Trend("coinflip duration");
291+
const contactsLatency = new Trend("contacts_duration");
292+
const coinflipLatency = new Trend("coinflip_duration");
293293
294294
export default function () {
295295
// Put visits to contact page in one group
@@ -335,8 +335,8 @@ k6 run multiple-flows.js --out json=results.json --iterations 10
335335
Look for the custom trend metrics in the end-of-test console summary:
336336
337337
```bash
338-
coinflip duration..............: avg=119.6438 min=116.481 med=118.4755 max=135.498 p(90)=121.8459 p(95)=123.89565
339-
contacts duration..............: avg=125.76985 min=116.973 med=120.6735 max=200.507 p(90)=127.9271 p(95)=153.87245
338+
coinflip_duration..............: avg=119.6438 min=116.481 med=118.4755 max=135.498 p(90)=121.8459 p(95)=123.89565
339+
contacts_duration..............: avg=125.76985 min=116.973 med=120.6735 max=200.507 p(90)=127.9271 p(95)=153.87245
340340
```
341341
342342
You can also query custom metric results from the JSON results. For example, to get the aggregated results as:
@@ -345,15 +345,15 @@ You can also query custom metric results from the JSON results. For example, to
345345
<CodeGroup labels={["Average", "Min", "Max"]} lineNumbers={[false]} showCopyButton={[true]} heightTogglers={[true]}>
346346
347347
```bash
348-
jq '. | select(.type == "Point" and .metric == "coinflip duration") | .data.value' results.json | jq -s 'add/length'
348+
jq '. | select(.type == "Point" and .metric == "coinflip_duration") | .data.value' results.json | jq -s 'add/length'
349349
```
350350
351351
```bash
352-
jq '. | select(.type == "Point" and .metric == "coinflip duration") | .data.value' results.json | jq -s min
352+
jq '. | select(.type == "Point" and .metric == "coinflip_duration") | .data.value' results.json | jq -s min
353353
```
354354
355355
```bash
356-
jq '. | select(.type == "Point" and .metric == "coinflip duration") | .data.value' results.json | jq -s max
356+
jq '. | select(.type == "Point" and .metric == "coinflip_duration") | .data.value' results.json | jq -s max
357357
```
358358
359359
</CodeGroup>

src/data/markdown/docs/05 Examples/02 Tutorials/01 Get started with k6/400 Reuse and re-run tests.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export const options = {
5656
const baseUrl = 'https://test.k6.io';
5757

5858
// Create custom trends
59-
const contactsLatency = new Trend('contacts duration');
60-
const coinflipLatency = new Trend('coinflip duration');
59+
const contactsLatency = new Trend('contacts_duration');
60+
const coinflipLatency = new Trend('coinflip_duration');
6161

6262
export default function () {
6363
// Put visits to contact page in one group
@@ -140,7 +140,7 @@ To do so, follow these steps:
140140
import { Trend } from "k6/metrics";
141141
import { group, sleep } from "k6";
142142
143-
const contactsLatency = new Trend("contact duration");
143+
const contactsLatency = new Trend("contact_duration");
144144
145145
export function contacts(baseUrl) {
146146
group('Contacts flow', function () {
@@ -210,7 +210,7 @@ To do so, follow these steps:
210210
import { Trend } from "k6/metrics";
211211
import { group, sleep } from "k6";
212212
213-
const contactsLatency = new Trend("contact duration");
213+
const contactsLatency = new Trend("contact_duration");
214214
215215
export function contacts(baseUrl) {
216216
group('Contacts flow', function () {
@@ -233,7 +233,7 @@ To do so, follow these steps:
233233
import { Trend } from "k6/metrics";
234234
import { group, sleep } from "k6";
235235
236-
const coinflipLatency = new Trend("coinflip duration");
236+
const coinflipLatency = new Trend("coinflip_duration");
237237
238238
export function coinflip(baseUrl) {
239239
group("Coinflip game", function () {

0 commit comments

Comments
 (0)