File tree Expand file tree Collapse file tree 4 files changed +45
-5
lines changed Expand file tree Collapse file tree 4 files changed +45
-5
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,10 @@ export function aggregateStats(data: Array<number>): IAggregateStats {
89
89
return instance . aggregateStats ( data )
90
90
}
91
91
92
- export function addSiteMeasurement ( event : string , obj ) : void {
92
+ export function addSiteMeasurement (
93
+ event : string ,
94
+ obj : ITelemetryTagsPayload [ "siteMeasurements" ]
95
+ ) : void {
93
96
instance . addSiteMeasurement ( event , obj )
94
97
}
95
98
Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ export interface ITelemetryTagsPayload {
108
108
bundleStats ?: unknown
109
109
pageDataStats ?: unknown
110
110
queryStats ?: unknown
111
+ SSRCount ?: number
112
+ DSGCount ?: number
113
+ SSGCount ?: number
111
114
}
112
115
errorV2 ?: IStructuredErrorV2
113
116
valueString ?: string
Original file line number Diff line number Diff line change @@ -380,10 +380,28 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
380
380
await waitMaterializePageMode
381
381
const waitWorkerPoolEnd = Promise . all ( workerPool . end ( ) )
382
382
383
- telemetry . addSiteMeasurement ( `BUILD_END` , {
384
- pagesCount : toRegenerate . length , // number of html files that will be written
385
- totalPagesCount : store . getState ( ) . pages . size , // total number of pages
386
- } )
383
+ {
384
+ let SSGCount = 0
385
+ let DSGCount = 0
386
+ let SSRCount = 0
387
+ for ( const page of store . getState ( ) . pages . values ( ) ) {
388
+ if ( page . mode === `SSR` ) {
389
+ SSRCount ++
390
+ } else if ( page . mode === `DSG` ) {
391
+ DSGCount ++
392
+ } else {
393
+ SSGCount ++
394
+ }
395
+ }
396
+
397
+ telemetry . addSiteMeasurement ( `BUILD_END` , {
398
+ pagesCount : toRegenerate . length , // number of html files that will be written
399
+ totalPagesCount : store . getState ( ) . pages . size , // total number of pages
400
+ SSRCount,
401
+ DSGCount,
402
+ SSGCount,
403
+ } )
404
+ }
387
405
388
406
const postBuildActivityTimer = report . activityTimer ( `onPostBuild` , {
389
407
parentSpan : buildSpan ,
Original file line number Diff line number Diff line change @@ -48,9 +48,25 @@ if (process.send) {
48
48
}
49
49
50
50
onExit ( ( ) => {
51
+ let SSGCount = 0
52
+ let DSGCount = 0
53
+ let SSRCount = 0
54
+ for ( const page of store . getState ( ) . pages . values ( ) ) {
55
+ if ( page . mode === `SSR` ) {
56
+ SSRCount ++
57
+ } else if ( page . mode === `DSG` ) {
58
+ DSGCount ++
59
+ } else {
60
+ SSGCount ++
61
+ }
62
+ }
63
+
51
64
telemetry . trackCli ( `DEVELOP_STOP` , {
52
65
siteMeasurements : {
53
66
totalPagesCount : store . getState ( ) . pages . size ,
67
+ SSRCount,
68
+ DSGCount,
69
+ SSGCount,
54
70
} ,
55
71
} )
56
72
} )
You can’t perform that action at this time.
0 commit comments