@@ -27,6 +27,7 @@ import { executeJqlQuery, JiraIssueNode, loginToJiraMessageNode, TreeViewIssue }
27
27
28
28
const AssignedWorkItemsViewProviderId = AssignedJiraItemsViewId ;
29
29
const RefreshCumulativeJqlFetchEventName = 'ui.jira.jqlFetch.update.lcp' ;
30
+ const InitialCumulativeJqlFetchEventName = 'ui.jira.jqlFetch.render.lcp' ;
30
31
31
32
export class AssignedWorkItemsViewProvider extends Disposable implements TreeDataProvider < TreeItem > {
32
33
private static readonly _treeItemConfigureJiraMessage = loginToJiraMessageNode ;
@@ -60,7 +61,15 @@ export class AssignedWorkItemsViewProvider extends Disposable implements TreeDat
60
61
61
62
const jqlEntries = Container . jqlManager . getAllDefaultJQLEntries ( ) ;
62
63
if ( jqlEntries . length ) {
63
- this . _initPromises = new PromiseRacer ( jqlEntries . map ( ( entry ) => executeJqlQuery ( entry , true ) ) ) ;
64
+ timer . mark ( InitialCumulativeJqlFetchEventName ) ;
65
+ const promises = jqlEntries . map ( executeJqlQuery ) ;
66
+ this . _initPromises = new PromiseRacer ( promises ) ;
67
+ Promise . all ( promises ) . then ( ( ) => {
68
+ const jqlInitialDuration = timer . measureAndClear ( InitialCumulativeJqlFetchEventName ) ;
69
+ performanceEvent ( InitialCumulativeJqlFetchEventName , jqlInitialDuration ) . then ( ( event ) => {
70
+ Container . analyticsClient . sendTrackEvent ( event ) ;
71
+ } ) ;
72
+ } ) ;
64
73
}
65
74
66
75
Container . context . subscriptions . push ( configuration . onDidChange ( this . onConfigurationChanged , this ) ) ;
@@ -153,13 +162,12 @@ export class AssignedWorkItemsViewProvider extends Disposable implements TreeDat
153
162
}
154
163
// this branch triggers when refresing an already rendered panel
155
164
else {
165
+ timer . mark ( RefreshCumulativeJqlFetchEventName ) ;
156
166
const jqlEntries = Container . jqlManager . getAllDefaultJQLEntries ( ) ;
157
167
if ( ! jqlEntries . length ) {
158
168
return [ AssignedWorkItemsViewProvider . _treeItemConfigureJiraMessage ] ;
159
169
}
160
- timer . mark ( RefreshCumulativeJqlFetchEventName ) ;
161
170
const allIssues = ( await Promise . all ( jqlEntries . map ( ( entry ) => executeJqlQuery ( entry ) ) ) ) . flat ( ) ;
162
- const jqlRefreshDuration = timer . measureAndClear ( RefreshCumulativeJqlFetchEventName ) ;
163
171
164
172
if ( this . _skipNotificationForNextFetch ) {
165
173
this . _skipNotificationForNextFetch = false ;
@@ -169,6 +177,7 @@ export class AssignedWorkItemsViewProvider extends Disposable implements TreeDat
169
177
}
170
178
171
179
SearchJiraHelper . setIssues ( allIssues , AssignedWorkItemsViewProviderId ) ;
180
+ const jqlRefreshDuration = timer . measureAndClear ( RefreshCumulativeJqlFetchEventName ) ;
172
181
performanceEvent ( RefreshCumulativeJqlFetchEventName , jqlRefreshDuration ) . then ( ( event ) => {
173
182
Container . analyticsClient . sendTrackEvent ( event ) ;
174
183
} ) ;
0 commit comments