Skip to content

Commit

Permalink
🧪 Ignore warmup period
Browse files Browse the repository at this point in the history
  • Loading branch information
polRk committed Oct 28, 2024
1 parent cbc85c1 commit ed161c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
github_token:
description: 'GitHub token used to access the GitHub API for inferring the pull request number.'
required: false
sdk_name:
description: 'The name of the SDK used by the user to generate load on the YDB database.'
required: true
# ydb_storage_node_count:
# description: 'Specifies the number of YDB storage nodes to initialize within the Docker Compose setup.'
# default: "1"
Expand All @@ -24,9 +27,10 @@ inputs:
report_template:
description: 'Path to a custom Markdown template used for generating the final SLO report.'
required: false
sdk_name:
description: 'The name of the SDK used by the user to generate load on the YDB database.'
required: true
warmup_seconds:
description: 'The duration of the warmup period in seconds.'
required: false
default: '30'

runs:
using: 'node20'
Expand Down
8 changes: 5 additions & 3 deletions init/post.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion init/src/jobs/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type { Series } from '../report/chart'
(async function post() {
let cwd = getState("cwd")
let sdk = getInput("sdk_name", { required: true })
let warmup = parseInt(getInput("warmup_seconds") || '0')

let end = new Date()
let start = new Date(getState("start"))
Expand All @@ -24,7 +25,8 @@ import type { Series } from '../report/chart'
let artifactClient = new DefaultArtifactClient()

info("Collecting metrics for head ref...")
let metrics = await collectPrometheus(start, end, defaultMetrics.metrics)
let adjStart = new Date(start.getTime() + warmup * 1000) // skip first warmup seconds
let metrics = await collectPrometheus(adjStart, end, defaultMetrics.metrics)
info(`Metrics collected for head ref: ${Object.keys(metrics)}`)
debug(`Head ref metrics: ${Object.keys(metrics)}`)

Expand Down

0 comments on commit ed161c2

Please sign in to comment.