chore: port lab 4 solution into the lab 5 skeleton
Source: mtusi2026lab4-safronov, solution/bvt2301-safronov, 2546deb. Contracts, public tests and evidence of lab 4 are not carried over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
// Сценарий write: ровно COUNT сообщений в чат записи от участников по
|
||||
// кругу, VUS клиентов одновременно. Читаемый чат не меняется.
|
||||
import exec from "k6/execution";
|
||||
|
||||
import {
|
||||
SUMMARY_THRESHOLDS,
|
||||
SUMMARY_TREND_STATS,
|
||||
WORK_DIR,
|
||||
sendMessage,
|
||||
summaryFiles,
|
||||
syntheticText,
|
||||
} from "./lib.js";
|
||||
|
||||
const fixture = JSON.parse(open(`${WORK_DIR}/fixture.json`));
|
||||
const OFFSET = Number(__ENV.OFFSET || 0);
|
||||
|
||||
export const options = {
|
||||
scenarios: {
|
||||
write: {
|
||||
executor: "shared-iterations",
|
||||
vus: Number(__ENV.VUS),
|
||||
iterations: Number(__ENV.COUNT),
|
||||
maxDuration: "10m",
|
||||
},
|
||||
},
|
||||
discardResponseBodies: true,
|
||||
summaryTrendStats: SUMMARY_TREND_STATS,
|
||||
thresholds: SUMMARY_THRESHOLDS,
|
||||
};
|
||||
|
||||
export default function () {
|
||||
const n = OFFSET + exec.scenario.iterationInTest;
|
||||
const sender = fixture.memberIds[n % fixture.memberIds.length];
|
||||
sendMessage(
|
||||
fixture.writeChatId,
|
||||
fixture.tokens[sender],
|
||||
syntheticText("w", n),
|
||||
);
|
||||
}
|
||||
|
||||
export function handleSummary(data) {
|
||||
return summaryFiles(data);
|
||||
}
|
||||
Reference in New Issue
Block a user