Changeset 57083
- Timestamp:
- 11/08/2023 10:30:21 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/performance.yml
r56972 r57083 163 163 npm run env:cli -- rewrite structure '/%year%/%monthnum%/%postname%/' --path=/var/www/${{ env.LOCAL_DIR }} 164 164 165 - name: Install additional languages 166 run: | 167 npm run env:cli -- language core install de_DE --path=/var/www/${{ env.LOCAL_DIR }} 168 npm run env:cli -- language plugin install de_DE --all --path=/var/www/${{ env.LOCAL_DIR }} 169 npm run env:cli -- language theme install de_DE --all --path=/var/www/${{ env.LOCAL_DIR }} 170 165 171 - name: Install MU plugin 166 172 run: | -
trunk/tests/performance/compare-results.js
r56934 r57083 24 24 25 25 // The list of test suites to log. 26 const testSuites = [ 'home-block-theme', 'home-classic-theme' ]; 26 const testSuites = [ 27 'admin', 28 'admin-l10n', 29 'home-block-theme', 30 'home-block-theme-l10n', 31 'home-classic-theme', 32 'home-classic-theme-l10n', 33 ]; 27 34 28 35 // The current commit's results. … … 129 136 console.log( 'Note: Due to the nature of how GitHub Actions work, some variance in the results is expected.\n' ); 130 137 138 /** 139 * Nicely formats a given value. 140 * 141 * @param {string} metric Metric. 142 * @param {number} value 143 */ 144 function formatValue( metric, value) { 145 if ( null === value ) { 146 return 'N/A'; 147 } 148 if ( 'wpMemoryUsage' === metric ) { 149 return `${ ( value / Math.pow( 10, 6 ) ).toFixed( 2 ) } MB`; 150 } 151 152 return `${ value.toFixed( 2 ) } ms`; 153 } 154 131 155 for ( const key of testSuites ) { 132 156 const current = testResults[ key ] || {}; … … 142 166 for ( const [ metric, values ] of Object.entries( current ) ) { 143 167 const value = median( values ); 144 const prevValue = median( prev[ metric ] );168 const prevValue = prev[ metric ] ? median( prev[ metric ] ) : null; 145 169 146 const delta = value - prevValue;170 const delta = null !== prevValue ? value - prevValue : 0 147 171 const percentage = ( delta / value ) * 100; 148 172 rows.push( { 149 173 Metric: metric, 150 Before: `${ prevValue.toFixed( 2 ) } ms`,151 After: `${ value.toFixed( 2 ) } ms`,152 'Diff abs.': `${ delta.toFixed( 2 ) } ms`,174 Before: formatValue( metric, prevValue ), 175 After: formatValue( metric, value ), 176 'Diff abs.': formatValue( metric, delta ), 153 177 'Diff %': `${ percentage.toFixed( 2 ) } %`, 154 178 } ); -
trunk/tests/performance/log-results.js
r55459 r57083 12 12 // The list of test suites to log. 13 13 const testSuites = [ 14 'admin', 15 'admin-l10n', 14 16 'home-block-theme', 17 'home-block-theme-l10n', 15 18 'home-classic-theme', 19 'home-classic-theme-l10n', 16 20 ]; 17 21 -
trunk/tests/performance/playwright.config.js
r56926 r57083 20 20 ...baseConfig, 21 21 globalSetup: require.resolve( './config/global-setup.js' ), 22 reporter: process.env.CI 23 ? './config/performance-reporter.js' 24 : [ [ 'list' ], [ './config/performance-reporter.js' ] ], 22 reporter: [ [ 'list' ], [ './config/performance-reporter.js' ] ], 25 23 forbidOnly: !! process.env.CI, 26 24 workers: 1, -
trunk/tests/performance/results.js
r56926 r57083 9 9 10 10 const testSuites = [ 11 'admin', 12 'admin-l10n', 11 13 'home-classic-theme', 14 'home-classic-theme-l10n', 12 15 'home-block-theme', 16 'home-block-theme-l10n', 13 17 ]; 14 18 -
trunk/tests/performance/specs/home-block-theme.test.js
r56926 r57083 42 42 const serverTiming = await metrics.getServerTiming(); 43 43 44 for ( const [ key, value] of Object.entries( serverTiming ) ) {44 for ( const [ key, value ] of Object.entries( serverTiming ) ) { 45 45 results[ camelCaseDashes( key ) ] ??= []; 46 46 results[ camelCaseDashes( key ) ].push( value ); -
trunk/tests/performance/specs/home-classic-theme.test.js
r56926 r57083 41 41 const serverTiming = await metrics.getServerTiming(); 42 42 43 for ( const [key, value] of Object.entries( serverTiming ) ) {43 for ( const [ key, value ] of Object.entries( serverTiming ) ) { 44 44 results[ camelCaseDashes( key ) ] ??= []; 45 45 results[ camelCaseDashes( key ) ].push( value ); -
trunk/tests/performance/wp-content/mu-plugins/server-timing.php
r56559 r57083 26 26 $server_timing_values['total'] = $server_timing_values['before-template'] + $server_timing_values['template']; 27 27 28 /* 29 * While values passed via Server-Timing are intended to be durations, 30 * any numeric value can actually be passed. 31 * This is a nice little trick as it allows to easily get this information in JS. 32 */ 33 $server_timing_values['memory-usage'] = memory_get_usage(); 34 28 35 $header_values = array(); 29 36 foreach ( $server_timing_values as $slug => $value ) {
Note: See TracChangeset
for help on using the changeset viewer.