mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: expose project time to production for project flag trends (#6068)
This commit is contained in:
parent
82e84ec14d
commit
55b2bb4813
@ -133,6 +133,7 @@ class ProjectStore implements IProjectStore {
|
||||
'project_settings.project',
|
||||
'projects.id',
|
||||
)
|
||||
.leftJoin('project_stats', 'project_stats.project', 'projects.id')
|
||||
.orderBy('projects.name', 'asc');
|
||||
|
||||
if (query) {
|
||||
@ -148,12 +149,14 @@ class ProjectStore implements IProjectStore {
|
||||
),
|
||||
'project_settings.default_stickiness',
|
||||
'project_settings.project_mode',
|
||||
'project_stats.avg_time_to_prod_current_window',
|
||||
] as (string | Raw<any>)[];
|
||||
|
||||
let groupByColumns = [
|
||||
'projects.id',
|
||||
'project_settings.default_stickiness',
|
||||
'project_settings.project_mode',
|
||||
'project_stats.avg_time_to_prod_current_window',
|
||||
];
|
||||
|
||||
if (userId) {
|
||||
@ -214,6 +217,7 @@ class ProjectStore implements IProjectStore {
|
||||
createdAt: row.created_at,
|
||||
mode: row.project_mode || 'open',
|
||||
defaultStickiness: row.default_stickiness || 'default',
|
||||
avgTimeToProduction: row.avg_time_to_prod_current_window || 0,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,12 @@ export const projectSchema = {
|
||||
description:
|
||||
'A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy',
|
||||
},
|
||||
avgTimeToProduction: {
|
||||
type: 'number',
|
||||
example: 10,
|
||||
description:
|
||||
'The average time from when a feature was created to when it was enabled in the "production" environment during the current window',
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
} as const;
|
||||
|
@ -501,6 +501,7 @@ export interface IProjectWithCount extends IProject {
|
||||
potentiallyStaleFeatureCount: number;
|
||||
memberCount: number;
|
||||
favorite?: boolean;
|
||||
avgTimeToProduction: number;
|
||||
}
|
||||
|
||||
export interface IClientSegment {
|
||||
|
1
src/test/fixtures/fake-project-store.ts
vendored
1
src/test/fixtures/fake-project-store.ts
vendored
@ -48,6 +48,7 @@ export default class FakeProjectStore implements IProjectStore {
|
||||
featureCount: 0,
|
||||
staleFeatureCount: 0,
|
||||
potentiallyStaleFeatureCount: 0,
|
||||
avgTimeToProduction: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user