1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-19 00:15:43 +01:00
unleash.unleash/src/test
Gastón Fournier a9f9be1efa
chore: add a class to handle aggreggation queries (#8446)
## About the changes
We have many aggregation queries that run on a schedule:
f63496d47f/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:
f63496d47f/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):
f02fe87835/src/lib/metrics-gauge.ts (L38-L40)

As an additional benefit, we get both the gauge definition and the
queries in a single place:
f02fe87835/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>
2024-10-18 11:11:22 +02:00
..
config feat: Disallow repeating last 5 passwords. (#7552) 2024-07-09 16:18:35 +02:00
e2e chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
examples chore: rename toggle to flag #final (#7146) 2024-05-24 15:07:01 +03:00
fixtures feat: return project roles (#8314) 2024-10-01 09:13:59 +00:00
arbitraries.test.ts chore: Upgrade to typescript 5.4.2 (#6605) 2024-03-19 10:46:08 +00:00