1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

chore: split metrics by request type (#6119)

## About the changes
Queries on client-feature-toggle store have many purposes depending on
the requestType, making the query more complex or not depending on the
use case. Also, each use case has different frequencies (i.e. playground
is expected to be used rarely).

The name for the store metrics was wrong, copy&pasted from:

7b04db0547/src/lib/features/feature-toggle/feature-toggle-store.ts (L107)

Which was also present in feature-tag metrics:

7b04db0547/src/lib/db/feature-tag-store.ts (L37)

With this, we'll have more granularity to understand the execution time
and frequency of each
This commit is contained in:
Gastón Fournier 2024-02-05 09:01:42 +01:00 committed by GitHub
parent 6007d2bbdc
commit 1d18187f7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class FeatureTagStore implements IFeatureTagStore {
this.logger = getLogger('feature-tag-store.ts'); this.logger = getLogger('feature-tag-store.ts');
this.timer = (action) => this.timer = (action) =>
metricsHelper.wrapTimer(eventBus, DB_TIME, { metricsHelper.wrapTimer(eventBus, DB_TIME, {
store: 'feature-toggle', store: 'feature-tag-toggle',
action, action,
}); });
} }

View File

@ -51,7 +51,7 @@ export default class FeatureToggleClientStore
this.logger = getLogger('feature-toggle-client-store.ts'); this.logger = getLogger('feature-toggle-client-store.ts');
this.timer = (action) => this.timer = (action) =>
metricsHelper.wrapTimer(eventBus, DB_TIME, { metricsHelper.wrapTimer(eventBus, DB_TIME, {
store: 'feature-toggle', store: 'client-feature-toggle',
action, action,
}); });
this.flagResolver = flagResolver; this.flagResolver = flagResolver;
@ -66,7 +66,7 @@ export default class FeatureToggleClientStore
const isAdmin = requestType === 'admin'; const isAdmin = requestType === 'admin';
const isPlayground = requestType === 'playground'; const isPlayground = requestType === 'playground';
const environment = featureQuery?.environment || DEFAULT_ENV; const environment = featureQuery?.environment || DEFAULT_ENV;
const stopTimer = this.timer('getFeatureAdmin'); const stopTimer = this.timer(`getFeatureAdmin${requestType}`);
let selectColumns = [ let selectColumns = [
'features.name as name', 'features.name as name',