1
0
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:
Christopher Kolstad 2024-01-02 16:02:03 +01:00 committed by GitHub
parent dc0df235dd
commit e993846471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);