mediawiki.inspect: Expose total size in bytes from mw.inspect
authorPeter Hedenskog <phedenskog@wikimedia.org>
Wed, 9 Mar 2016 09:03:03 +0000 (10:03 +0100)
committerKrinkle <krinklemail@gmail.com>
Wed, 9 Mar 2016 13:33:24 +0000 (13:33 +0000)
To make it easier for the Performance inspector plugin lets expose
the total size in bytes from inspect, so it can be used to calculate
the total size and graph the data.

There's one drawback with the fix: the total size is
also included in the console log, adding one extra field when you
log the data as a table. The method is generic that logs the data
and I don't want to change that.

Bug: T129319
Change-Id: Ic7ccbe624f07443942974a71f8a0b3f94074bb55

resources/src/mediawiki/mediawiki.inspect.js

index 671f38f..fdb7adf 100644 (file)
 
                                // Convert size to human-readable string.
                                $.each( modules, function ( i, module ) {
+                                       module.sizeInBytes = module.size;
                                        module.size = humanSize( module.size );
                                } );