mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-01 01:18:10 +02:00
task: add timer for client feature query (#5734)
Adds a database query timer for the client features query.
This commit is contained in:
parent
dc0df235dd
commit
e993846471
@ -533,6 +533,7 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
|||||||
tag,
|
tag,
|
||||||
namePrefix,
|
namePrefix,
|
||||||
}: IFeatureProjectUserParams): Promise<IFeatureOverview[]> {
|
}: IFeatureProjectUserParams): Promise<IFeatureOverview[]> {
|
||||||
|
const stopTimer = this.timer('getFeatureOverview');
|
||||||
let query = this.db('features').where({ project: projectId });
|
let query = this.db('features').where({ project: projectId });
|
||||||
|
|
||||||
if (tag) {
|
if (tag) {
|
||||||
@ -620,6 +621,7 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
|||||||
|
|
||||||
query = query.select(selectColumns);
|
query = query.select(selectColumns);
|
||||||
const rows = await query;
|
const rows = await query;
|
||||||
|
stopTimer();
|
||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
const overview = this.getFeatureOverviewData(rows);
|
const overview = this.getFeatureOverviewData(rows);
|
||||||
return sortEnvironments(overview);
|
return sortEnvironments(overview);
|
||||||
|
Loading…
Reference in New Issue
Block a user