Log thumbnail access
authorGilles Dubuc <gdubuc@wikimedia.org>
Mon, 20 Jul 2015 17:59:36 +0000 (19:59 +0200)
committerGilles Dubuc <gdubuc@wikimedia.org>
Mon, 20 Jul 2015 18:37:31 +0000 (20:37 +0200)
Bug: T106323
Change-Id: Iddd4201b13a31f441c6d25bcde6564b643cefdb4

includes/filerepo/file/File.php
thumb.php

index f9e1128..72b3ae9 100644 (file)
@@ -1149,6 +1149,8 @@ abstract class File implements IDBAccessObject {
                        Hooks::run( 'FileTransformed', array( $this, $thumb, $tmpThumbPath, $thumbPath ) );
                }
 
+               wfDebugLog( 'thumbnailaccess', time() . ' ' . $thumbPath . ' ' . filesize( $tmpThumbPath ) . ' Generated ' );
+
                return $thumb;
        }
 
index 5c4eea7..3b7ff43 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -309,6 +309,7 @@ function wfStreamThumb( array $params ) {
                        wfThumbError( 500, 'Could not stream the file' );
                } else {
                        RequestContext::getMain()->getStats()->timing( 'media.thumbnail.stream', $streamtime );
+                       wfDebugLog( 'thumbnailaccess', time() . ' ' . $thumbPath . ' ' . ob_get_length() . ' Streamed ' );
                }
                return;
        }