openshift-pipelines / pipelines-as-code

Pipelines-as-Code for Tekton
https://pipelinesascode.com
Apache License 2.0
137 stars 81 forks source link

Add new metric to show duration all pipelineruns have taken #1764

Closed zakisk closed 1 month ago

zakisk commented 2 months ago

added new metric to show sum of durations all pipelineruns have taken in seconds. added docs and adjusted test accordingly

https://issues.redhat.com/browse/SRVKP-6226

Screenshot from 2024-09-20 16-55-20

Changes

Submitter Checklist

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 72.13115% with 17 lines in your changes missing coverage. Please review.

Project coverage is 65.16%. Comparing base (d87fe97) to head (528f8ed). Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pkg/metrics/metrics.go 62.85% 9 Missing and 4 partials :warning:
pkg/reconciler/emit_metrics.go 84.61% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1764 +/- ## ========================================== + Coverage 65.11% 65.16% +0.04% ========================================== Files 174 174 Lines 13185 13246 +61 ========================================== + Hits 8586 8632 +46 - Misses 4030 4041 +11 - Partials 569 573 +4 ``` | [Flag](https://app.codecov.io/gh/openshift-pipelines/pipelines-as-code/pull/1764/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openshift-pipelines) | Coverage ฮ” | | |---|---|---| | [](https://app.codecov.io/gh/openshift-pipelines/pipelines-as-code/pull/1764/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openshift-pipelines) | `65.16% <72.13%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openshift-pipelines#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

zakisk commented 2 months ago

/test

zakisk commented 2 months ago

/test

zakisk commented 1 month ago

/test

zakisk commented 1 month ago

Thank you @zakisk Few comments and also can you add e2e to test both the metrics

@savitaashture about adding E2E tests, I will need to do some extra work, like adding an ingress to access metrics endpoint in tests, metrics endpoint doesn't return response in JSON so need to figure out a consistent way to find metrics values in response so that it will be reusable across all PAC metrics E2E tests, so I am thinking doing that in a separate SRVKP. CC: @chmouel

savitaashture commented 1 month ago

/lgtm

Thank you