-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- **New Features** - Introduced a load testing script for PostgreSQL database concurrency. - Added a new Dockerfile for building a Go application with health check. - Implemented PostgreSQL database connection and handling in the Go SDK example. - **Enhancements** - Search functionality now supports custom HTTP headers. - Updated Kubernetes configurations with namespace, labels, and environment variables. - **Bug Fixes** - Fixed the initialization of `inflightRequests` to prevent logic errors in request handling. - **Refactor** - Replaced `wget` with `curl` for HTTP requests to improve reliability and performance. - Modified `flow.go` to better manage inflight requests. --------- Co-authored-by: Hardik Shingala <[email protected]>
- Loading branch information
1 parent
f061ccb
commit d17df66
Showing
41 changed files
with
494 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
playground/scenarios/postgres-concurrency/load-generator/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { randomIntBetween } from "https://jslib.k6.io/k6-utils/1.4.0/index.js"; | ||
import { check, sleep } from "k6"; | ||
import { vu } from "k6/execution"; | ||
import http from "k6/http"; | ||
|
||
export let vuStages = [ | ||
{ duration: "10s", target: 10 }, | ||
{ duration: "2m", target: 50 }, | ||
{ duration: "10s", target: 10 }, | ||
]; | ||
|
||
export let options = { | ||
discardResponseBodies: true, | ||
scenarios: { | ||
guests: { | ||
executor: "ramping-vus", | ||
stages: vuStages, | ||
env: { USER_TYPE: "guest" }, | ||
}, | ||
subscribers: { | ||
executor: "ramping-vus", | ||
stages: vuStages, | ||
env: { USER_TYPE: "subscriber" }, | ||
}, | ||
}, | ||
}; | ||
|
||
export default function () { | ||
let userType = __ENV.USER_TYPE; | ||
let userId = vu.idInTest; | ||
const url = "http://aperture-go-example.aperture-go-example.svc.cluster.local:80/postgres"; | ||
const headers = { | ||
"Content-Type": "application/json", | ||
Cookie: | ||
"session=eyJ1c2VyIjoia2Vub2JpIn0.YbsY4Q.kTaKRTyOIfVlIbNB48d9YH6Q0wo", | ||
"User-Type": userType, | ||
"User-Id": userId, | ||
}; | ||
const body = {} | ||
let res = http.request("POST", url, JSON.stringify(body), { | ||
headers: headers, | ||
}); | ||
const ret = check(res, { | ||
"http status was 200": res.status === 200, | ||
}); | ||
if (!ret) { | ||
// sleep for 10ms to 25ms | ||
sleep(randomIntBetween(0.01, 0.025)); | ||
} | ||
} |
Oops, something went wrong.