Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

視聴履歴エンドポイントに負荷をかけるシナリオのパラメータ調整 #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions k6/viewing-history-load-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const options = {

preAllocatedVUs: 20,
stages: [
{ target: 1, duration: '1s' },
{ target: 1, duration: '1s' },
{ target: 5, duration: '5s' },
{ target: 5, duration: '30s' },
],
},
},
Expand Down Expand Up @@ -85,21 +85,18 @@ export function fetchEpisodes (offset, limit) {
}

export function setup() {
// const offsets = [0, 50, 100, 150, 200];
const offsets = [0];
let episodes = [];

offsets.forEach((offset) => {
episodes = episodes.concat(fetchEpisodes(offset, 50));
})
console.log(episodes.length);
return { episodes: episodes };
}

export function load_test(data) {
const episodes = data.episodes;

console.log(episodes[0]);
userIDs.forEach((userID) => {
const viewingHistoryRequests = Array();
const episodeIDs = Array();
Expand Down Expand Up @@ -130,4 +127,3 @@ function check_status_ok(res) {
fail(`status is not 200. response: ${JSON.stringify(res)}`);
}
}

Loading