client/lib/perfmon/index.js
function checkActivePlaceholders() {
	const placeholdersCount = activePlaceholders.length;
	debug( `Checking active placeholders. Count: ${ placeholdersCount }` );

	if ( placeholdersCount > 0 ) {
		activePlaceholderEverDetected = true;
	}

	// record event if there ever were any placeholders and if they all just disappeared
	if ( activePlaceholderEverDetected && placeholdersCount === 0 ) {
		// tell tracks to record duration
		const { startTime, trigger } = determineTimingType();
		const duration = Math.round( performance.now() - startTime );
		debug( `Recording placeholder wait. Duration: ${ duration }, Trigger: ${ trigger }` );
		analytics.timing.record( `placeholder-wait.${ trigger }`, duration );
		stopMutationObserver();
	}
}
function checkActivePlaceholders() {
	const placeholdersCount = activePlaceholders.length;
	debug( `Checking active placeholders. Count: ${ placeholdersCount }` );

	if ( placeholdersCount > 0 ) {
		activePlaceholderEverDetected = true;
	}

	// record event if there ever were any placeholders and if they all just disappeared
	if ( activePlaceholderEverDetected && placeholdersCount === 0 ) {
		// tell tracks to record duration
		const { startTime, trigger } = determineTimingType();
		const duration = Math.round( performance.now() - startTime );
		debug( `Recording placeholder wait. Duration: ${ duration }, Trigger: ${ trigger }` );
		analytics.timing.record( `placeholder-wait.${ trigger }`, duration );
		stopMutationObserver();
	}
}
function checkActivePlaceholders ( ) { const placeholdersCount = activePlaceholders . length ; debug ( ` ${ placeholdersCount } ` ) ; if ( placeholdersCount > 0 ) { activePlaceholderEverDetected = true ; } // record event if there ever were any placeholders and if they all just disappeared if ( activePlaceholderEverDetected && placeholdersCount === 0 ) { // tell tracks to record duration const { startTime , trigger } = determineTimingType ( ) ; const duration = Math . round ( performance . now ( ) - startTime ) ; debug ( ` ${ duration } ${ trigger } ` ) ; analytics . timing . record ( ` ${ trigger } ` , duration ) ; stopMutationObserver ( ) ; } }
Check if there are any placeholders on the screen and trigger a timing event when all the placeholders are gone
Check if there are any placeholders on the screen and trigger a timing event when all the placeholders are gone