https://github.com/mohitk05/xk6-close-idle-connections
k6 extension to close idle connections at a defined interval
https://github.com/mohitk05/xk6-close-idle-connections
http k6 k6-extension xk6
Last synced: about 2 months ago
JSON representation
k6 extension to close idle connections at a defined interval
- Host: GitHub
- URL: https://github.com/mohitk05/xk6-close-idle-connections
- Owner: mohitk05
- License: mit
- Created: 2024-09-03T13:00:03.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-23T13:20:47.000Z (7 months ago)
- Last Synced: 2025-02-07T19:33:44.526Z (4 months ago)
- Topics: http, k6, k6-extension, xk6
- Language: Go
- Homepage:
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xk6-close-idle-connections
[k6](https://github.com/grafana/k6) extension to close idle TCP connections (per VU) at a defined interval.## Build
```bash
xk6 build v0.52.0 --with github.com/mohitk05/xk6-close-idle-connections@latest
```## Usage
```javascript
import * as closeIdleConnections from 'k6/x/close_idle_conn';export default function () {
// Will only run once for a VU, subsequent calls will return immediately
closeIdleConnections.start(10); // closes idle connections every 10 seconds
// Your test script
}export function teardown() {
closeIdleConnections.stop();
}
```