-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Mitesh411/newscript
Update script.js
- Loading branch information
Showing
1 changed file
with
6 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import http from 'k6/http'; | ||
// This will export to HTML as filename "result.html" AND also stdout using the text summary json=results.json | ||
import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js"; | ||
import { textSummary } from "https://jslib.k6.io/k6-summary/0.1.0/index.js"; | ||
import { check, sleep } from 'k6'; | ||
|
||
export const options ={ | ||
vus: 5, | ||
duration: '3s' | ||
} | ||
export default function () { | ||
const res =http.get('https://mitesh411.github.io/MyResume/'); | ||
check(res,{'Status was 200': r => r.status == 200}); | ||
sleep(1); | ||
} | ||
export const options = { | ||
iterations: 1, | ||
}; | ||
|
||
export function handleSummary(data){ | ||
return { | ||
'index.html': htmlReporter(data), | ||
stdout: textSummary(data, { indent: " ", enableColors: true }), | ||
} | ||
} | ||
export default function () { | ||
const response = http.get('https://test-api.k6.io/public/crocodiles/'); | ||
} |