1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib
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
..
__snapshots__ feat: ability to configure when users are considered inactive (#8454) 2024-10-15 16:34:04 +02:00
addons chore: improve addon metrics usage 2024-10-14 09:20:27 +02:00
db chore: add timers to count queries (#8393) 2024-10-08 15:41:00 +02:00
domain/project-health
error fix: validate patched data with schema (#7616) 2024-07-18 13:26:50 +01:00
features chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
middleware [Gitar] Cleaning up stale flag: stripHeadersOnAPI with value true (#8457) 2024-10-16 09:30:32 +02:00
openapi chore: update schemas related to Unleash AI chat (#8463) 2024-10-16 14:44:37 +01:00
routes Restructure features documentation (#8394) 2024-10-16 13:59:30 +02:00
schema fix: trim role names before validation (#8277) 2024-09-26 11:52:51 +00:00
services fix: group and user has at least 1 project owner counter respects multirole project groups (#8453) 2024-10-16 12:47:00 +02:00
types fix: group and user has at least 1 project owner counter respects multirole project groups (#8453) 2024-10-16 12:47:00 +02:00
users feat: ability to configure when users are considered inactive (#8454) 2024-10-15 16:34:04 +02:00
util chore: wrapTimer function types (#8428) 2024-10-15 11:18:22 +02:00
app.test.ts
app.ts chore: origin middleware (#7695) 2024-07-30 10:42:50 +01:00
create-config.test.ts fix: prevent config resolver snapshot test (#8041) 2024-09-02 15:14:34 +02:00
create-config.ts feat: ability to configure when users are considered inactive (#8454) 2024-10-15 16:34:04 +02:00
default-custom-auth-deny-all.ts
internals.ts
logger.test.ts
logger.ts
metric-events.ts feat: user loging event emitting with login order (#8021) 2024-08-30 11:28:19 +02:00
metrics-gauge.test.ts chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
metrics-gauge.ts chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
metrics.test.ts chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
metrics.ts chore: add a class to handle aggreggation queries (#8446) 2024-10-18 11:11:22 +02:00
server-impl.test.ts chore: remove featureLifecycle and featureLifecycleMetrics flags (#7808) 2024-08-08 13:45:23 +02:00
server-impl.ts