jenkins-bot has submitted this change and it was merged.

Change subject: Change perfstat size:domserialized to size:wikitext.
......................................................................


Change perfstat size:domserialized to size:wikitext.

- Show the perfstats for the correct last 10 commits, instead of the first 10.
- Protect against null perfstats, which can happen when renaming or adding
new ones.

Change-Id: Ic0949385ac7ed8829479437bc5e493438d707765
---
M js/tests/roundtrip-test.js
M js/tests/server/server.js
2 files changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/js/tests/roundtrip-test.js b/js/tests/roundtrip-test.js
index 9105bc7..27bc58d 100755
--- a/js/tests/roundtrip-test.js
+++ b/js/tests/roundtrip-test.js
@@ -408,7 +408,7 @@
                env.profile.time.serialize = new Date();
                out = new WikitextSerializer( { env: env } 
).serializeDOM(document.body);
                env.profile.time.serialize = new Date() - 
env.profile.time.serialize;
-               env.profile.size.domserialized = out.length;
+               env.profile.size.wikitext = out.length;
 
                // Finish the total time now
                if ( env.profile && env.profile.time ) {
diff --git a/js/tests/server/server.js b/js/tests/server/server.js
index 071c33e..26d524b 100755
--- a/js/tests/server/server.js
+++ b/js/tests/server/server.js
@@ -397,7 +397,7 @@
        'JOIN commits ON perfstats.commit_hash = commits.hash ' +
        'WHERE pages.prefix = ? AND pages.title = ? ' +
        'GROUP BY commits.hash ' +
-       'ORDER BY commits.timestamp ASC ' +
+       'ORDER BY commits.timestamp DESC ' +
        'LIMIT 0, ?';
 
 var transUpdateCB = function( title, prefix, hash, type, res, trans, 
success_cb, err, result ) {
@@ -608,6 +608,11 @@
 };
 
 var displayPerfStat = function( type, value ) {
+       // Protect against not-present perfstats, i.e. when adding new ones.
+       if ( value === null ) {
+               return '';
+       }
+
        var text = '<span title="' + value.toString() + '">';
        if ( type.match( /^time/ ) ) {
                // Show time in seconds
@@ -1178,11 +1183,13 @@
                                        }
                                        res.write( '</tr>' );
 
-                                       for ( var r = 0; r < rows.length; r++ ) 
{
+                                       // Show the results in order of 
timestamp.
+                                       for ( var r = rows.length - 1; r >= 0; 
r-- ) {
                                                var row = rows[r];
                                                res.write( '<tr><td 
class="title"><span title="' +
-                                                       
row.timestamp.toString() + '">' + row.hash +
-                                                       '</span></td>' );
+                                                       
row.timestamp.toString() + '">' +
+                                                       '<a href="/result/' + 
row.hash + '/' + prefix + '/' + title + '">' +
+                                                       row.hash + '</a>' + 
'</span></td>' );
                                                for ( t = 0; t < types.length; 
t++ ) {
                                                        res.write( '<td>' + 
displayPerfStat( types[ t ], row[ types[ t ] ] ) + '</td>' );
                                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/85032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0949385ac7ed8829479437bc5e493438d707765
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Marcoil <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Marcoil <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to