Skip to content
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

Different value format for the workflows stats #265

Open
orensbruli opened this issue Oct 23, 2023 · 4 comments
Open

Different value format for the workflows stats #265

orensbruli opened this issue Oct 23, 2023 · 4 comments
Labels
type/feature-request Requested new feature or enhancement

Comments

@orensbruli
Copy link

image

The values of the skipped/successes/failures/cancelled workflows stats are sent to Grafana like shown in the image.
This makes it more difficult to represent it in a pie or any other graph.
Could we just send the int value and let Grafana calculate the percentage?

@orensbruli
Copy link
Author

My best guess is that it comes from here:

skippedRate = fmt.Sprintf("%d (%.2f%%)", usage.SkippedRuns, float32(usage.SkippedRuns)/float32(usage.Runs)*100.0)
}
var averageRunDuration time.Duration
nonSkippedRuns := uint64(usage.Runs) - usage.SkippedRuns
if nonSkippedRuns > 0 {
averageRunDuration = (usage.TotalRunDuration / time.Duration(nonSkippedRuns)).Round(time.Second)
}
if nonSkippedRuns > 0 {
successRate = fmt.Sprintf("%d (%.2f%%)", usage.SuccessfulRuns, float32(usage.SuccessfulRuns)/float32(nonSkippedRuns)*100.0)
failureRate = fmt.Sprintf("%d (%.2f%%)", usage.FailedRuns, float32(usage.FailedRuns)/float32(nonSkippedRuns)*100.0)
cancelledRate = fmt.Sprintf("%d (%.2f%%)", usage.CancelledRuns, float32(usage.CancelledRuns)/float32(nonSkippedRuns)*100.0)

If we still need the percentages, can we create specific columns for those?

@orensbruli
Copy link
Author

orensbruli commented Oct 23, 2023

And the change could be something like this? #266

I would appreciate your thoughts @PoorlyDefinedBehaviour

@gabor gabor added the type/feature-request Requested new feature or enhancement label Oct 27, 2023
@PoorlyDefinedBehaviour
Copy link
Member

And the change could be something like this? #266

I would appreciate your thoughts @PoorlyDefinedBehaviour

Sounds good to me

@richgreen-moj
Copy link

This would be super useful for us 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Requested new feature or enhancement
Projects
Status: Backlog
Development

No branches or pull requests

4 participants