This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
Fix unused version in Running Workflows metric #3386
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApply
to fix any format violations.Changes in this PR
Describe the new behavior from this PR, and why it's needed
The current "running workflows" metric doesn't record what it thinks it's recording. The query for
getPendingWorkflowCount
ONLY takes aname
parameter. There is no concept of version. So, the metric is just repeated AND, the same query is run over and over and over again for X versions.This is a performance improvement as well. If someone were to have 100++ of versions for a workflow, this Monitor was making the same exact query over and over for those X versions.
This is more correct given the structure we currently have setup for pending workflows.
Alternatives considered
Describe alternative implementation you have considered
In the future, we could look at adding the version to for backends that are maintaining a "pending workfow" set. Right now that doesn't exist, so this is better given the actual structure we have right now.