Permalink
Browse files

Merge branch 'pageload'

  • Loading branch information...
2 parents 81fc96e + 971a442 commit e26fc65f5d1e1d32c741f822dc5eb38e6b818e76 @nwgh nwgh committed Mar 19, 2013
Showing with 5,118 additions and 1,381 deletions.
  1. +9 −0 config.ini.example
  2. +19 −49 head.js
  3. +0 −45 linux/init/client/srworker
  4. +16 −0 linux/user/etc_gdm_custom.conf
  5. +9 −0 linux/user/srterm.py
  6. +23 −0 linux/user/srwrapper.py
  7. +10 −0 linux/user/stoneridge.desktop
  8. +0 −27 osx/org.mozilla.srworker.plist
  9. +10 −0 osx/terminal_setup.sh
  10. +65 −0 pageloader/README
  11. +4 −0 pageloader/chrome.manifest
  12. +301 −0 pageloader/chrome/srpl.js
  13. +58 −0 pageloader/chrome/srpl.xul
  14. +111 −0 pageloader/chrome/srquit.js
  15. +186 −0 pageloader/components/sr-cmdline.js
  16. +20 −0 pageloader/install.rdf
  17. +64 −0 srdata.js
  18. +11 −34 srnamed.py
  19. +17 −1 srrun.py
  20. +44 −21 srrunner.py
  21. +35 −6 srunpacker.py
  22. +10 −10 srworker.py
  23. +103 −35 stoneridge.py
  24. +3 −0 tests/pinterest.page
  25. +99 −0 tools/wprexplode.py
  26. +36 −17 windows/srwebworker.py
  27. +2 −0 windows/srworker.bat
  28. +10 −0 wpr/PKG-INFO
  29. +260 −0 wpr/cachemissarchive.py
  30. +123 −0 wpr/cachemissarchive_test.py
  31. +115 −42 wpr/customhandlers.py
  32. 0 wpr/daemonserver.py
  33. +42 −0 wpr/deterministic.js
  34. +79 −62 wpr/dnsproxy.py
  35. +488 −163 wpr/httparchive.py
  36. +347 −0 wpr/httparchive_test.py
  37. +250 −71 wpr/httpclient.py
  38. +73 −42 wpr/httpproxy.py
  39. 0 wpr/httpzlib.py
  40. +10 −0 wpr/mock-archive.txt
  41. +59 −0 wpr/mockhttprequest.py
  42. 0 wpr/perftracker/__init__.py
  43. +14 −0 wpr/perftracker/app/appengine_config.py
  44. +2 −0 wpr/perftracker/extension/background.html
  45. +88 −27 wpr/perftracker/runner.py
  46. 0 wpr/persistentmixin.py
  47. +289 −78 wpr/platformsettings.py
  48. +245 −0 wpr/platformsettings_test.py
  49. +270 −142 wpr/replay.py
  50. +29 −34 wpr/replayspdyserver.py
  51. +131 −0 wpr/servermanager.py
  52. +5 −0 wpr/setup.cfg
  53. +57 −0 wpr/setup.py
  54. +12 −0 wpr/third_party/dns/README.web-page-replay
  55. +12 −0 wpr/third_party/ipaddr/README.web-page-replay
  56. +194 −256 wpr/third_party/ipaddr/ipaddr.py
  57. +106 −60 wpr/third_party/ipaddr/ipaddr_test.py
  58. +15 −1 wpr/third_party/ipaddr/test-2to3.sh
  59. +25 −0 wpr/third_party/ipfw_win32/LICENSE
  60. +12 −0 wpr/third_party/ipfw_win32/README.web-page-replay
  61. +16 −5 wpr/third_party/nbhttp/README.web-page-replay
  62. +22 −0 wpr/third_party/nbhttp/__init__.py
  63. +22 −21 wpr/third_party/nbhttp/client.py
  64. +22 −21 wpr/third_party/nbhttp/push_tcp.py
  65. +22 −21 wpr/third_party/nbhttp/server.py
  66. +22 −21 wpr/third_party/nbhttp/spdy_client.py
  67. +10 −2 wpr/third_party/nbhttp/spdy_common.py
  68. +22 −21 wpr/third_party/nbhttp/spdy_server.py
  69. +52 −30 wpr/trafficshaper.py
  70. +6 −16 wpr/trafficshaper_test.py
  71. +47 −0 wpr/util.py
  72. +10 −0 wpr/webpagereplay.egg-info/PKG-INFO
  73. +209 −0 wpr/webpagereplay.egg-info/SOURCES.txt
  74. +1 −0 wpr/webpagereplay.egg-info/dependency_links.txt
  75. +4 −0 wpr/webpagereplay.egg-info/entry_points.txt
  76. +1 −0 wpr/webpagereplay.egg-info/requires.txt
  77. +3 −0 wpr/webpagereplay.egg-info/top_level.txt
View
@@ -86,6 +86,11 @@ keep = 50
# corresponds to 15 minutes
timeout = 900
+[firefox]
+# How long to wait for firefox before killing it, in seconds. The value below
+# corresponds to 15 minutes
+timeout = 900
+
[mqproxy]
# Where to keep the proxy database for windows queue entries
db = /Users/hurley/src/stoneridge/testroot/mqproxy.db
@@ -112,6 +117,10 @@ download_suffix = dmg
# firefox for win and linux, and FirefoxNightly.app/Contents/MacOS for mac
firefox_path = FirefoxNightly.app/Contents/MacOS
+# The name of the firefox binary, firefox for mac and linux, firefox.exe
+# for windows
+firefox = firefox
+
# The name of the xpcshell binary, xpcshell for mac and linux, xpcshell.exe
# for windows
xpcshell = xpcshell
View
68 head.js
@@ -7,36 +7,24 @@
* test suite. This must be run under xpcshell running in JS v1.8 mode.
*/
+/*jshint curly:true, indent:4, latedef:true, undef:true,
+ trailing:true, es5:true, esnext:true*/
+/*global Components:true, run_test:true, _SR_OUT_FILE:true,
+ do_save_results:true*/
+
var STONERIDGE_FINISHED = null;
-var STONERIDGE_RESULTS = null;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
/*
- * Store some results for writing once we're all done
- */
-function do_write_result(key, start, stop) {
- var startms = start.valueOf();
- var stopms = stop.valueOf();
-
- var val = {'start':startms, 'stop':stopms, 'total':stopms - startms};
-
- if (STONERIDGE_RESULTS.hasOwnProperty(key)) {
- STONERIDGE_RESULTS[key].push(val);
- } else {
- STONERIDGE_RESULTS[key] = [val];
- }
-}
-
-/*
* This is used to indicate that the tests are done. Now that we know we're
* done, we can write the results to disk for the python harness to do its thing
* with.
*/
function do_test_finish() {
- STONERIDGE_FINISHED = true;
+ STONERIDGE_FINISHED = true;
}
/*
@@ -45,45 +33,27 @@ function do_test_finish() {
*/
function do_test_pending() {}
-function _do_save_results() {
- // Create a file pointing to our output directory
- var ofile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
- ofile.initWithPath(_SR_OUT_SUBDIR);
-
- // And use the file determined by our caller
- ofile.append(_SR_OUT_FILE);
-
- // Now get an output stream for our file
- var ostream = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- ostream.init(ofile, -1, -1, 0);
-
- var jstring = JSON.stringify(STONERIDGE_RESULTS);
- ostream.write(jstring, jstring.length);
- ostream.close();
-}
-
function make_channel(url) {
- var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
- return ios.newChannel(url, "", null);
+ var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+ return ios.newChannel(url, "", null);
}
/*
* The main entry point for all stone ridge tests
*/
function do_stoneridge() {
- STONERIDGE_FINISHED = false;
- STONERIDGE_RESULTS = {};
+ STONERIDGE_FINISHED = false;
- run_test();
+ run_test();
- // Pump the event loop until we're told to stop
- var thread = Cc["@mozilla.org/thread-manager;1"].
- getService().currentThread;
- while (!STONERIDGE_FINISHED)
- thread.processNextEvent(true);
- while (thread.hasPendingEvents())
- thread.processNextEvent(true);
+ // Pump the event loop until we're told to stop
+ var thread = Cc["@mozilla.org/thread-manager;1"].getService().currentThread;
+ while (!STONERIDGE_FINISHED) {
+ thread.processNextEvent(true);
+ }
+ while (thread.hasPendingEvents()) {
+ thread.processNextEvent(true);
+ }
- _do_save_results();
+ do_save_results(_SR_OUT_FILE);
}
View
@@ -1,45 +0,0 @@
-#!/bin/bash
-#
-# srworker Stone Ridge worker process
-#
-# chkconfig: 2345 98 09
-# description: srworker is responsible for running tests
-
-### BEGIN INIT INFO
-# Provides: srworker
-# Required-Start: $local_fs $network
-# Required-Stop: $local_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start and stop stoneridge worker
-# Description: stoneridge worker runs tests
-### END INIT INFO
-
-source /etc/default/stoneridge
-
-PID=$SRHOME/srworker.pid
-LOG=$SRHOME/srworker.log
-
-start() {
- python $SRRUN $SRROOT/srworker.py --config $CONFFILE --pidfile $PID --log $LOG
-}
-
-stop() {
- kill $(cat $PID)
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|force-reload|reload)
- stop
- start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}"
- exit 2
-esac
@@ -0,0 +1,16 @@
+# GDM configuration storage
+
+[daemon]
+AutomaticLoginEnable=true
+AutomaticLogin=hurley
+
+[security]
+
+[xdmcp]
+
+[greeter]
+
+[chooser]
+
+[debug]
+
View
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+import subprocess
+
+SRWRAPPER = '/home/hurley/srhome/stoneridge/linux/user/srwrapper.py'
+
+p = subprocess.Popen(['/usr/bin/gnome-terminal', '-t', 'Stone Ridge',
+ '-e', SRWRAPPER])
+p.wait()
View
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+import subprocess
+import sys
+import time
+
+SRHOME = '/home/hurley/srhome'
+SRPYTHON = '%s/stoneridge' % (SRHOME,)
+SRRUN = '%s/srrun.py' % (SRPYTHON,)
+SRWORKER = '%s/srworker.py' % (SRPYTHON,)
+SRINI = '%s/stoneridge.ini' % (SRHOME,)
+LOG = '%s/srworker.log' % (SRHOME,)
+
+cli = [sys.executable, SRRUN, SRWORKER, '--config', SRINI, '--log', LOG]
+
+p = subprocess.Popen(cli)
+p.wait()
+
+while True:
+ # Sleep indefinitely in case of failure, so we choose when to kill the
+ # terminal. This isn't particularly useful on the actual infrastructure,
+ # but it works great for debugging errors during testing.
+ time.sleep(60)
@@ -0,0 +1,10 @@
+
+[Desktop Entry]
+Type=Application
+Exec=/home/hurley/srhome/stoneridge/linux/user/srterm.py
+Hidden=false
+X-GNOME-Autostart-enabled=true
+Name[en_US]=Stone Ridge
+Name=Stone Ridge
+Comment[en_US]=Start a terminal running the stone ridge worker
+Comment=Start a terminal running the stone ridge worker
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Label</key>
- <string>org.mozilla.srworker</string>
- <key>ProgramArguments</key>
- <array>
- <string>/usr/local/bin/python</string>
- <string>/Users/hurley/srhome/stoneridge/srworker.py</string>
- <string>--config</string>
- <string>/Users/hurley/srhome/stoneridge.ini</string>
- <string>--nodaemon</string>
- <string>--log</string>
- <string>/Users/hurley/srhome/srworker.log</string>
- </array>
- <key>KeepAlive</key>
- <true/>
- <key>WorkingDirectory</key>
- <string>/Users/hurley/srhome/stoneridge</string>
- <key>EnvironmentVariables</key>
- <dict>
- <key>PATH</key>
- <string>/usr/local/share/python:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin</string>
- </dict>
-</dict>
-</plist>
View
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+defaults write com.apple.Terminal 'Window Settings' -dict-add 'Stone Ridge' '{ CommandString = "/usr/local/bin/python /Users/hurley/srhome/stoneridge/srworker.py --config /Users/hurley/srhome/stoneridge.ini --log /Users/hurley/srhome/srworker.log"; ProfileCurrentVersion = "2.02"; RunCommandAsShell = 0; name = "Stone Ridge"; type = "Window Settings"; }'
+defaults write com.apple.Terminal 'Default Window Settings' 'Stone Ridge'
+defaults write com.apple.Terminal 'Startup Window Settings' 'Stone Ridge'
+osascript -e 'tell app "System Events"
+make login item at end with properties {path:"/Applications/Utilities/Terminal.app", hidden:false}
+end tell'
+echo "Setting auto login user (needs root privs)"
+sudo defaults write /Library/Preferences/com.apple.loginwindow.plist autoLoginUser hurley
View
@@ -0,0 +1,65 @@
+Pageload Test Component
+=======================
+
+Usage:
+
+ ./firefox -tp file:///path/to/manifest.txt [-tpargs...]
+
+See ./firefox -help for other arguments.
+
+
+Manifest file format
+====================
+
+Comments in the manifest file start with a #. Each line may be:
+
+* a URL (absolute or relative to the manifest)
+
+This URL is added to the list of tests.
+
+* one or more flags, followed by whitespace, followed by a URL
+
+The only flag supported currently is '%', which indicates that
+a test will do its own timing. (See Self-timing Tests below.)
+
+* "include" followed by whitespace, followed by a URL
+
+Parse the given manifest file.
+
+Self-timing Tests
+=================
+
+Most timing tests are interested in timing how long it takes the page
+to load; that is, from the start of page loading until the 'load'
+event is dispatched. By default, this is what the pageloader will
+time. However, if a test URL has the % flag, the test is expected to
+report its own timing. For this purpose, the pageloader will provide
+a function named "tpRecordTime" in the test's global object that it
+should call once it has performed whatever timing it wants to do.
+The given value will be used as the timing result for this test.
+
+Output format
+=============
+
+The result is a dump to stdout via dump() --
+browser.dom.window.dump.enabled must be set to true in the profile.
+
+Sample output:
+
+__start_tp_report
+_x_x_mozilla_page_load,778.5,NaN,NaN
+_x_x_mozilla_page_load_details,avgmedian|778.5|average|766.75|minimum|NaN|maximum|NaN|stddev|NaN|0;file:///c:/proj/mozilla-cvs/perf/tp2/base/www.cnn.com/index.html;778.5;766.75;722;1027;1027;788;777;722;780|...
+__end_tp_report
+
+Note that the minimum, maximum, stddev are not calculated; they're
+always reported as NaN. (They were the minimum and maximum values of
+any sampled value, and the standard deviation across all sampled
+values -- not very useful.)
+
+TODO
+====
+
+* Command line option to choose whether to run with or without browser chrome. Currently runs without.
+
+* Tinderbox-dropping style output
+ * better yet would be to teach tinderbox about JSON
@@ -0,0 +1,4 @@
+content srpl chrome/
+component {E17FB86D-1CEB-4B67-8A6C-5B97AD068A7F} components/sr-cmdline.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=sr {E17FB86D-1CEB-4B67-8A6C-5B97AD068A7F}
+category command-line-handler m-sr @mozilla.org/commandlinehandler/general-startup;1?type=sr
Oops, something went wrong.

0 comments on commit e26fc65

Please sign in to comment.