Skip to content

Commit ae5b4ae

Browse files
authored
Fix http fault api and examples (#1109)
* Fix the argument's case in examples * Reference the get-started section for exposing the example application Signed-off-by: Pablo Chacin <[email protected]>
1 parent 681bb8e commit ae5b4ae

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

src/data/markdown/docs/40 xk6-disruptor/03 API/01 Faults/01 HTTP .md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A HTTP fault is described by the following attributes:
1111
| --------- | ------------|
1212
| averageDelay | average delay added to requests in milliseconds (default `0ms`) |
1313
| delayVariation| variation in the injected delay in milliseconds (default `0ms`) |
14-
| errorBody | body to be returned when an error in injected |
14+
| errorBody | body to be returned when an error is injected |
1515
| errorCode | error code to return |
1616
| errorRate | rate of requests that will return an error, represented as a float in the range `0.0` to `1.0` (default `0.0`) |
1717
| exclude | comma-separated list of urls to be excluded from disruption (e.g. /health) |
@@ -29,8 +29,8 @@ This example defines a HTTP fault that introduces a delay of `50ms` in all reque
2929

3030
```javascript
3131
const fault = {
32-
average_delay: 50,
33-
error_code: 500,
34-
error_rate: 0.1,
32+
averageDelay: 50,
33+
errorCde: 500,
34+
errorRate: 0.1,
3535
};
3636
```

src/data/markdown/docs/40 xk6-disruptor/04 Examples/01 Inject HTTP faults into Pod.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ export function disrupt(data) {
6363
const podDisruptor = new PodDisruptor(selector)
6464
// delay traffic from one random replica of the deployment
6565
const fault = {
66-
average_delay: 50,
67-
error_code: 500,
68-
error_rate: 0.1
66+
averageDelay: 50,
67+
errorCode: 500,
68+
errorRate: 0.1
6969
}
7070
podDisruptor.injectHTTPFaults(fault, 30)
7171
}
@@ -355,19 +355,10 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
355355
service/httpbin LoadBalancer 10.96.169.78 172.18.255.200 80:31224/TCP 1m
356356
```
357357

358-
You can retrieve the external IP address in the environment variable `SVC_IP` using the following command:
359-
360-
<CodeGroup labels={["Linux/MacOS", "Windows PowerShell"]}>
361-
362-
```bash
363-
SVC_IP=$(kubectl -n httpbin get svc httpbin --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
364-
```
358+
You must set the environment variable `SVC_IP` with the external IP address and port used to access the `httpbin` service from the test script.
365359

366-
```Powershell
367-
$Env:SVC_IP=$(kubectl -n httpbin get svc httpbin --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
368-
```
360+
You can learn more about how to get the external IP address in the [expose your application](/javascript-api/xk6-disruptor/get-started/expose-your-application) section.
369361

370-
</CodeGroup>
371362

372363
### Manifests
373364

0 commit comments

Comments
 (0)