-
Notifications
You must be signed in to change notification settings - Fork 881
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
Conversation
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.
We should use rules that work well with smaller deployments. I suggest using last N builds, where N is maybe 10. |
@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. |
var ret = make(map[uuid.UUID]float64) | ||
for _, record := range records { | ||
val, err := strconv.ParseFloat(record.AvgBuildTimeSec, 64) | ||
if err == nil { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
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. |
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.