import http from "k6/http";
import { check, sleep } from "k6";
export let options = {
stages: [
{ duration: "0.1m", target: 1 }, // Start with 1 virtual user
{ duration: "0.5m", target: 300}, // Gradually increase to 10 virtual users over 5 minutes
{ duration: "1m", target: 300 }, // Stay at 10 virtual users for 2 minutes
],
};
export default function () {
const videoURL = "https://storage.googleapis.com/mangoapps/autozone.mangoapps.com/videos/pulse/autozone-com/attachments/134055/0/1688089478914_TheAutoZoneStorycopy.mp4";
const videoDurationSeconds = 10; // Video duration in seconds
// Generate a random byte range for the Range header
const startByte = Math.floor(Math.random() * (11.1*1000000); // Change the maximum value based on video size
// Set the Range header with the random byte range
const headers = { Range: `bytes=${startByte}-2097152` };
// Make an HTTP GET request to the video URL with the Range header
const res = http.request("GET", videoURL, null, { headers });
// console.log(res);
check(res, {
"Status is 206": (r) => r.status === 206, // Partial Content response
"Correct content type": (r) =>r.headers["Content-Type"] === "video/mp4",
});
// Simulate a delay to represent video playback time
sleep(videoDurationSeconds);
}
I want to test the breaking point and compare the results but i am getting unexpected result
Apart from getting more successful request using google_api services i m getting low percentage of request sucessful
it’s showing request timeout and request failed !!
so is there any limitation that google_storage service does not allow , or considers my k6 script VU’s as DOS Attack !
please help i m a beginner , i dont know the reason why am i getting request timeout error in less no. of target users