Skip to content

Commit

Permalink
feat(runner): Export stats chain bootstrap duration
Browse files Browse the repository at this point in the history
Reorder CSV stats
  • Loading branch information
mhofman committed Jan 9, 2022
1 parent 73932d4 commit 94f1c27
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
9 changes: 9 additions & 0 deletions runner/lib/stats/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ export const makeRunStats = (data) => {
savedData.endedAt &&
rounder(savedData.endedAt - savedData.startedAt);

const getChainBootstrapStartedAt = () =>
stages[0] && stages[0].chainStartedAt;
const getChainBootstrapEndedAt = () => stages[0] && stages[0].chainReadyAt;
const getChainBootstrapDuration = () =>
stages[0] && stages[0].chainInitDuration;

const getWalletDeployDuration = () =>
savedData.walletDeployStartedAt &&
savedData.walletDeployEndedAt &&
Expand Down Expand Up @@ -217,6 +223,9 @@ export const makeRunStats = (data) => {
stages: () => stages,
stageCount: getStageCount,
duration: getDuration,
chainBootstrapStartedAt: getChainBootstrapStartedAt,
chainBootstrapEndedAt: getChainBootstrapEndedAt,
chainBootstrapDuration: getChainBootstrapDuration,
walletDeployDuration: getWalletDeployDuration,
loadgenDeployDuration: getLoadgenDeployDuration,
}),
Expand Down
3 changes: 3 additions & 0 deletions runner/lib/stats/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ export interface RunStats extends RunStatsInitData {
readonly startedAt: TimeValueS | undefined;
readonly endedAt: TimeValueS | undefined;
readonly duration: number | undefined;
readonly chainBootstrapStartedAt: TimeValueS | undefined;
readonly chainBootstrapEndedAt: TimeValueS | undefined;
readonly chainBootstrapDuration: number | undefined;
readonly walletDeployStartedAt: TimeValueS | undefined;
readonly walletDeployEndedAt: TimeValueS | undefined;
readonly walletDeployDuration: number | undefined;
Expand Down
14 changes: 8 additions & 6 deletions scripts/perf_to_stats_csv.jq
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
select(has("stats")) |
.stats |
{
sdkRevision: (.metadata.testData.sdkRevision | tostring),
sdkCommitTime: (.metadata.testData.sdkCommitTime | strftime("%Y-%m-%d %H:%M:%S")),
sdkRevision: (.metadata.testData.sdkRevision // "" | tostring),
sdkCommitTime: (.metadata.testData.sdkCommitTime | strftime("%Y-%m-%d %H:%M:%S")? // ""),
success: (.duration != null),
chainBootstrapDuration: (.chainBootstrapDuration // .stages["0"].chainInitDuration),
walletDeployDuration: .walletDeployDuration,
loadgenDeployDuration: .loadgenDeployDuration,
cycleAvgDuration: .cyclesSummary.avgDuration,
cycleSuccessRate: .cyclesSummary.cycleSuccessRate,
cycleAvgDuration: .cyclesSummary.avgDuration,
} + (.stages | with_entries(
(.key | tonumber) as $stageIndex |
.value.stageConfig as $stageConfig |
("stage" + .key + "_") as $stagePrefix |
if ($stageIndex > 0 and $stageIndex < 5) then
{ key: ($stagePrefix + "cycleAvgDuration"), value: .value.cyclesSummaries.all.avgDuration },
if ($stageConfig["chainOnly"] != true and $stageConfig["durationConfig"] != 0) then
{ key: ($stagePrefix + "cycleSuccessRate"), value: .value.cyclesSummaries.all.cycleSuccessRate },
{ key: ($stagePrefix + "cycleAvgDuration"), value: .value.cyclesSummaries.all.avgDuration },
{ key: ($stagePrefix + "avgSwingsetBlockTime"), value: .value.blocksSummaries.onlyLive.avgSwingsetTime },
{ key: ($stagePrefix + "avgSwingsetPercentage"), value: .value.blocksSummaries.onlyLive.avgSwingsetPercentage },
empty
else empty end
))
Expand Down

0 comments on commit 94f1c27

Please sign in to comment.