1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00
unleash.unleash/src
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
..
lib chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
mailtemplates feat: now you can add env type to env order (#8442) 2024-10-14 13:26:38 +03:00
migrations chore: update schemas related to Unleash AI chat (#8463) 2024-10-16 14:44:37 +01:00
test chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
migrator.ts
server-dev.ts feat: release plans nav menu item and icon suggestion (#8469) 2024-10-18 08:23:52 +02:00
server.ts