$headers[] = 'Vary: ' . implode( ', ', $varyHeader );
}
- $stats = RequestContext::getMain()->getStats();
-
// Stream the file if it exists already...
$thumbPath = $img->getThumbPath( $thumbName );
if ( $img->getRepo()->fileExists( $thumbPath ) ) {
if ( !$success ) {
wfThumbError( 500, 'Could not stream the file' );
} else {
- $stats->timing( 'media.thumbnail.stream', $streamtime );
+ RequestContext::getMain()->getStats()->timing( 'media.thumbnail.stream', $streamtime );
+ wfDebugLog( 'thumbnailaccess', time() . ' ' . $thumbPath . ' ' . ob_get_length() . ' Streamed ' );
}
return;
}
return;
}
- // Actually generate a new thumbnail
- $starttime = microtime( true );
list( $thumb, $errorMsg ) = wfGenerateThumbnail( $img, $params, $thumbName, $thumbPath );
- $generatetime = microtime( true ) - $starttime;
+
/** @var MediaTransformOutput|bool $thumb */
// Check for thumbnail generation errors...
if ( $errorMsg !== false ) {
wfThumbError( $errorCode, $errorMsg );
} else {
- $stats->timing( 'media.thumbnail.generate', $generatetime );
-
// Stream the file if there were no errors
$success = $thumb->streamFile( $headers );
if ( !$success ) {