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 {
8989 return instance . aggregateStats ( data )
9090}
9191
92- export function addSiteMeasurement ( event : string , obj ) : void {
92+ export function addSiteMeasurement (
93+ event : string ,
94+ obj : ITelemetryTagsPayload [ "siteMeasurements" ]
95+ ) : void {
9396 instance . addSiteMeasurement ( event , obj )
9497}
9598
Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ export interface ITelemetryTagsPayload {
108108 bundleStats ?: unknown
109109 pageDataStats ?: unknown
110110 queryStats ?: unknown
111+ SSRCount ?: number
112+ DSGCount ?: number
113+ SSGCount ?: number
111114 }
112115 errorV2 ?: IStructuredErrorV2
113116 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> {
380380 await waitMaterializePageMode
381381 const waitWorkerPoolEnd = Promise . all ( workerPool . end ( ) )
382382
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+ }
387405
388406 const postBuildActivityTimer = report . activityTimer ( `onPostBuild` , {
389407 parentSpan : buildSpan ,
Original file line number Diff line number Diff line change @@ -48,9 +48,25 @@ if (process.send) {
4848}
4949
5050onExit ( ( ) => {
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+
5164 telemetry . trackCli ( `DEVELOP_STOP` , {
5265 siteMeasurements : {
5366 totalPagesCount : store . getState ( ) . pages . size ,
67+ SSRCount,
68+ DSGCount,
69+ SSGCount,
5470 } ,
5571 } )
5672} )
You can’t perform that action at this time.
0 commit comments