|
Ran
|
Jobs
1
|
Files
682
|
Run time
1min
|
Badge
README BADGES
|
push
github
chore: add a class to handle aggreggation queries (#8446) ## About the changes We have many aggregation queries that run on a schedule: https://github.com/Unleash/unleash/blob/<a class=hub.com/Unleash/unleash/commit/f63496d47f6808a246732f5ddee9b9136e23eca7">f63496d47/src/lib/metrics.ts#L714-L719 These staticCounters are usually doing db query aggregations that traverse tables and we run all of them in parallel: https://github.com/Unleash/unleash/blob/f63496d47f6808a246732f5ddee9b9136e23eca7/src/lib/metrics.ts#L410-L412 This can add strain to the db. This PR suggests a way of handling these queries in a more structured way, allowing us to run them sequentially (therefore spreading the load): https://github.com/Unleash/unleash/blob/<a class=hub.com/Unleash/unleash/commit/f02fe87835c30d77ff8b6755268e123585820511">f02fe8783/src/lib/metrics-gauge.ts#L38-L40 As an additional benefit, we get both the gauge definition and the queries in a single place: https://github.com/Unleash/unleash/blob/f02fe87835c30d77ff8b6755268e123585820511/src/lib/metrics.ts#L131-L141 This PR only tackles 1 metric, and it only focuses on gauges to gather initial feedback. The plan is to migrate these metrics and eventually incorporate more types (e.g. counters) --------- Co-authored-by: Nuno Góis <github@nunogois.com>
2744 of 3574 branches covered (76.78%)
220 of 268 new or added lines in 3 files covered. (82.09%)
3 existing lines in 2 files now uncovered.14007 of 15987 relevant lines covered (87.61%)
723.14 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 11400892401.1 | 0 |
87.61 |
GitHub Action Run |