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:
parent
6007d2bbdc
commit
1d18187f7d
@ -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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -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',
|
||||||
|
Loading…
Reference in New Issue
Block a user