-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the stats infrastructure to collect and summarize loadgen run data
- Loading branch information
Showing
18 changed files
with
1,715 additions
and
64 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** @typedef {import('../stats/types.js').StageStats} StageStats */ | ||
|
||
/** | ||
* @param {import("../tasks/types.js").RunLoadgenInfo} loadgenInfo | ||
* @param {Object} param1 | ||
* @param {StageStats} param1.stats | ||
* @param {Console} param1.console | ||
*/ | ||
export const monitorLoadgen = async ({ taskEvents }, { stats, console }) => { | ||
for await (const event of taskEvents) { | ||
const { time } = event; | ||
switch (event.type) { | ||
case 'start': { | ||
const { task, seq } = event; | ||
console.log('start', task, seq); | ||
const cycle = stats.getOrMakeCycle({ task, seq }); | ||
cycle.recordStart(time); | ||
break; | ||
} | ||
case 'finish': { | ||
const { task, seq, success } = event; | ||
console.log('finish', event.task, event.seq); | ||
const cycle = stats.getOrMakeCycle({ task, seq }); | ||
cycle.recordEnd(time, success); | ||
break; | ||
} | ||
case 'status': | ||
default: | ||
} | ||
} | ||
}; |
Oops, something went wrong.