$context Mutated in place by the build's stages. * @return array */ public static function resolve(array $inputs, array &$context): array { $sessionId = $inputs['session_id']; $recorded = ABJ_404_Solution_AjaxStageDiagnostics::runStage($context, 'canary_size_target', static function () use ($sessionId) { return ABJ_404_Solution_EncodedTableResponseSize::forSession($sessionId); }); if (is_int($recorded['bytes']) && $recorded['bytes'] > 0) { return array( 'realResponseBytes' => $recorded['bytes'], 'realResponseBytesSource' => $recorded['source'], 'realResponseRequestId' => $recorded['request_id'], 'realResponseRecordedSource' => $recorded['source'], ); } // Deliberately NOT inside the stage above: the builder opens its own // stage and trace stages are flat, so nesting would only mark // canary_size_target `superseded`. See MeasuredTableResponseSize. $measured = ABJ_404_Solution_MeasuredTableResponseSize::forSubpage($inputs['subpage'], $context); return array( 'realResponseBytes' => $measured['bytes'], 'realResponseBytesSource' => $measured['source'], // No request id: a measurement is of this site's table, not of any // one request, and borrowing a request id would imply otherwise. 'realResponseRequestId' => '', 'realResponseRecordedSource' => $recorded['source'], ); } }