Skip to content

Commit 65b92a9

Browse files
chore: fix prettier config and run prettier on all files (#1460)
* chore: update prettier parser to markdown * chore: run prettier on next folder * chore: run prettier on v0.48.x folder * chore: run prettier on v0.47.x folder * chore: fix indentation * chore: fix indentation * chore: apply patch to previous versions * chore: apply patch to v0.47 * chore: fix broken canonical links * chore: add S3MultipartUpload page * chore: fix indentation on running-k6
1 parent fb34756 commit 65b92a9

File tree

891 files changed

+6007
-5672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

891 files changed

+6007
-5672
lines changed

docs/sources/.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"files": ["**/*.md"],
99
"options": {
10-
"parser": "babel"
10+
"parser": "markdown"
1111
}
1212
}
1313
]

docs/sources/next/examples/api-crud-operations.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ export default (authToken) => {
154154
```javascript
155155
import { describe, expect } from 'https://jslib.k6.io/k6chaijs/4.3.4.3/index.js';
156156
import { Httpx } from 'https://jslib.k6.io/httpx/0.1.0/index.js';
157-
import { randomIntBetween, randomItem, randomString } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
157+
import {
158+
randomIntBetween,
159+
randomItem,
160+
randomString,
161+
} from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
158162

159163
export const options = {
160164
// for the example, let's run only 1 VU with 1 iteration

docs/sources/next/examples/correlation-and-dynamic-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default function () {
110110
**Relevant k6 APIs**:
111111

112112
- [Selection.find(selector)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-html/selection/selection-find) (the [jQuery Selector API](http://api.jquery.com/category/selectors/)
113-
docs are also a good resource on what possible selector queries can be made)
113+
docs are also a good resource on what possible selector queries can be made)
114114
- [Selection.attr(name)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-html/selection/selection-attr)
115115

116116
### Generic extraction of values/tokens

docs/sources/next/examples/data-uploads.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ const txt = open('/path/to/text.txt');
118118
export default function () {
119119
const fd = new FormData();
120120
fd.append('someTextField', 'someValue');
121-
fd.append('aBinaryFile', { data: new Uint8Array(img1).buffer, filename: 'logo.png', content_type: 'image/png' });
121+
fd.append('aBinaryFile', {
122+
data: new Uint8Array(img1).buffer,
123+
filename: 'logo.png',
124+
content_type: 'image/png',
125+
});
122126
fd.append('anotherTextField', 'anotherValue');
123127
fd.append('images', http.file(img1, 'image1.png', 'image/png'));
124128
fd.append('images', http.file(img2, 'image2.jpg', 'image/jpeg'));

docs/sources/next/examples/distribute-workloads.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ To inspect the results for a certain behavior, you can [create a custom metric](
1919
These techniques can create very complex configurations.
2020
However, more complexity creates more ambiguity in result interpretation
2121

22-
{{% /admonition %}}
22+
{{% /admonition %}}
2323

2424
## Split logic across scenarios
2525

2626
{{% admonition type="note" %}}
2727

2828
In this context, _workload_ refers to the traffic pattern simulated by a scenario.
2929

30-
{{% /admonition %}}
30+
{{% /admonition %}}
3131

3232
One way to distribute traffic is to use scenarios to schedule different workloads for different functions.
3333

docs/sources/next/examples/get-started-with-k6/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ The tutorial requires the following:
3838

3939
## Tutorials
4040

41-
| In this tutorial | Learn how to |
42-
| ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
41+
| In this tutorial | Learn how to |
42+
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
4343
| [Test for functional behavior](https://grafana.com/docs/k6/<K6_VERSION>/examples/get-started-with-k6/test-for-functional-behavior) | Use k6 to script requests and evaluate that performance is correct |
4444
| [Test for performance](https://grafana.com/docs/k6/<K6_VERSION>/examples/get-started-with-k6/test-for-performance) | Use k6 to increase load and find faults |
4545
| [Analyze results](https://grafana.com/docs/k6/<K6_VERSION>/examples/get-started-with-k6/analyze-results) | Filter results and make custom metrics |

docs/sources/next/examples/get-started-with-k6/analyze-results.md

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jq '. | select(.type == "Point" and .data.tags.status == "200")' results.json
7575
Or calculate the aggregated value of any metric with any particular tags.
7676
7777
{{< code >}}
78+
7879
```average
7980
jq '. | select(.type == "Point" and .metric == "http_req_duration") | .data.value' results.json | jq -s 'add/length'
8081
```
@@ -86,6 +87,7 @@ jq '. | select(.type == "Point" and .metric == "http_req_duration") | .data.valu
8687
```max
8788
jq '. | select(.type == "Point" and .metric == "http_req_duration") | .data.value' results.json | jq -s max
8889
```
90+
8991
{{< /code >}}
9092
9193
## Apply custom tags
@@ -132,7 +134,7 @@ export default function () {
132134
}
133135
```
134136
135-
{{< /code >}}
137+
{{< /code >}}
136138
137139
Run the test:
138140
@@ -193,8 +195,8 @@ export default function () {
193195
sleep(1);
194196
}
195197
```
196-
{{< /code >}}
197198
199+
{{< /code >}}
198200
199201
### Add Group functions
200202
@@ -212,22 +214,22 @@ import { group, sleep } from 'k6';
212214
const baseUrl = 'https://test.k6.io';
213215
214216
export default function () {
215-
// visit some endpoints in one group
216-
group('Contacts flow', function () {
217-
http.get(`${baseUrl}/contacts.php`);
218-
sleep(1);
219-
// return to the home page
220-
http.get(`${baseUrl}/`);
221-
sleep(1);
222-
});
217+
// visit some endpoints in one group
218+
group('Contacts flow', function () {
219+
http.get(`${baseUrl}/contacts.php`);
220+
sleep(1);
221+
// return to the home page
222+
http.get(`${baseUrl}/`);
223+
sleep(1);
224+
});
223225
224-
// Coinflip players in another group
225-
group('Coinflip game', function () {
226-
http.get(`${baseUrl}/flip_coin.php?bet=heads`);
227-
sleep(1);
228-
http.get(`${baseUrl}/flip_coin.php?bet=tails`);
229-
sleep(1);
230-
});
226+
// Coinflip players in another group
227+
group('Coinflip game', function () {
228+
http.get(`${baseUrl}/flip_coin.php?bet=heads`);
229+
sleep(1);
230+
http.get(`${baseUrl}/flip_coin.php?bet=tails`);
231+
sleep(1);
232+
});
231233
}
232234
```
233235
@@ -279,35 +281,35 @@ const contactsLatency = new Trend('contacts_duration');
279281
const coinflipLatency = new Trend('coinflip_duration');
280282
281283
export default function () {
282-
// Put visits to contact page in one group
283-
let res;
284-
group('Contacts flow', function () {
285-
// save response as variable
286-
res = http.get(`${baseUrl}/contacts.php`);
287-
// add duration property to metric
288-
contactsLatency.add(res.timings.duration);
289-
sleep(1);
290-
291-
res = http.get(`${baseUrl}/`);
292-
// add duration property to metric
293-
contactsLatency.add(res.timings.duration);
294-
sleep(1);
295-
});
284+
// Put visits to contact page in one group
285+
let res;
286+
group('Contacts flow', function () {
287+
// save response as variable
288+
res = http.get(`${baseUrl}/contacts.php`);
289+
// add duration property to metric
290+
contactsLatency.add(res.timings.duration);
291+
sleep(1);
292+
293+
res = http.get(`${baseUrl}/`);
294+
// add duration property to metric
295+
contactsLatency.add(res.timings.duration);
296+
sleep(1);
297+
});
296298
297-
// Coinflip players in another group
299+
// Coinflip players in another group
298300
299-
group('Coinflip game', function () {
300-
// save response as variable
301-
let res = http.get(`${baseUrl}/flip_coin.php?bet=heads`);
302-
// add duration property to metric
303-
coinflipLatency.add(res.timings.duration);
304-
sleep(1);
301+
group('Coinflip game', function () {
302+
// save response as variable
303+
let res = http.get(`${baseUrl}/flip_coin.php?bet=heads`);
304+
// add duration property to metric
305+
coinflipLatency.add(res.timings.duration);
306+
sleep(1);
305307
306-
res = http.get(`${baseUrl}/flip_coin.php?bet=tails`);
307-
// add duration property to metric
308-
coinflipLatency.add(res.timings.duration);
309-
sleep(1);
310-
});
308+
res = http.get(`${baseUrl}/flip_coin.php?bet=tails`);
309+
// add duration property to metric
310+
coinflipLatency.add(res.timings.duration);
311+
sleep(1);
312+
});
311313
}
312314
```
313315
@@ -329,6 +331,7 @@ contacts_duration..............: avg=125.76985 min=116.973 med=120.6735 max=200
329331
You can also query custom metric results from the JSON results. For example, to get the aggregated results as.
330332
331333
{{< code >}}
334+
332335
```avg
333336
jq '. | select(.type == "Point" and .metric == "coinflip_duration") | .data.value' results.json | jq -s 'add/length'
334337
```
@@ -340,6 +343,7 @@ jq '. | select(.type == "Point" and .metric == "coinflip_duration") | .data.valu
340343
```max
341344
jq '. | select(.type == "Point" and .metric == "coinflip_duration") | .data.value' results.json | jq -s max
342345
```
346+
343347
{{< /code >}}
344348
345349
## Next steps

0 commit comments

Comments
 (0)