Skip to content

Compute template average build time #3999

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

Closed
wants to merge 5 commits into from
Closed

Compute template average build time #3999

wants to merge 5 commits into from

Conversation

iskhakovt
Copy link

Metric for templates -- average build time, only builds within the last day are considered, if the number of builds is <10, the template doesn't get this metric.

Resolve #3784.

@ammario
Copy link
Member

ammario commented Sep 11, 2022

Thank you for the contribution! I see this only affects the backend. We typically only merge end to end features, but one of us internally can complete this if you don't have the time.

average build time, only builds within the last day are considered, if the number of builds is <10, the template doesn't get this metric.

We should use rules that work well with smaller deployments. I suggest using last N builds, where N is maybe 10.

@iskhakovt iskhakovt requested a review from a team as a code owner September 11, 2022 23:15
@iskhakovt iskhakovt requested review from code-asher and removed request for a team September 11, 2022 23:15
@iskhakovt
Copy link
Author

@ammario I made the query more configurable: it now does a moving average between start_ts and end_ts, takes last moving_average_size jobs and filters out templates with less than min_completed_job_count jobs; either condition can be voided.
I've also added a column in the view.

var ret = make(map[uuid.UUID]float64)
for _, record := range records {
val, err := strconv.ParseFloat(record.AvgBuildTimeSec, 64)
if err == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean err != nil

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test to metricscache to cover average build times?

@github-actions
Copy link

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Sep 20, 2022
@code-asher code-asher removed their request for review September 20, 2022 17:01
@github-actions github-actions bot closed this Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show build time in templates page
3 participants