-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
90 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import { check } from "k6"; | ||
import { check, sleep } from "k6"; | ||
import http from "k6/http"; | ||
|
||
export const options = { | ||
stages: [ | ||
{ duration: "30s", target: 20 }, | ||
{ duration: "1m30s", target: 10 }, | ||
{ duration: "20s", target: 0 }, | ||
], | ||
stages: [ | ||
{ duration: "60s", target: 100 }, // Ramp-up to 100 users over 30s | ||
{ duration: "60s", target: 200 }, // Ramp-up to 200 users over 1 minute | ||
{ duration: "60s", target: 300 }, // Ramp-up to 300 users over 1 minute | ||
{ duration: "60s", target: 500 }, // Ramp-down to 0 users over 1 minute | ||
], | ||
}; | ||
|
||
export default function () { | ||
const res = http.post("http://localhost:5046/api/MongoTest/MongoPost"); | ||
check(res, { "status was 200": (r) => r.status == 200 }); | ||
const url = 'http://localhost:8848/api/MongoLock/BusinessTest'; | ||
|
||
const payload = JSON.stringify({ | ||
email: 'aaa', | ||
password: 'bbb' | ||
}); | ||
|
||
const params = { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}; | ||
|
||
const res = http.post(url, params); | ||
check(res, { "status was 200": (r) => r.status == 200 }); | ||
|
||
// Optional: Add a small sleep to simulate real user behavior | ||
sleep(1); | ||
} |
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