Work in progress porting from SQLite to MySQL.

- Basic fetch queries should work but that path will have a lot of debug
  output that will want deleting.

- Stats and other queries not ported at all

- Connection variables currently hardcoded and should be a config

- This branch started out as an attempt to do transactionless SQLite
  version with atomic operations so there may be cruft from that to
  clean up.

Change-Id: If4b2c2518f296a89a409a3a5328de5fc88aeac3b
Merge "Work in progress porting from SQLite to MySQL." into rt_testing
Port the round-trip test server to MySQL.
- Also ported importJson to mysql.
- Commit results and stats correctly.
- Don't use (for now) the new claimPage function, as it doesn't record the
commits.
- Pass connection parameters as command line options.

TODO:
- Improve performance, possibly using transactions.
- Record performance numbers (bug #46659).
- Remove debugging output.
Bug: 44652

Change-Id: I25ef1f909308676e311180c9cdfceca7f91118fb
Correctly record crashing titles as errors after a number of retries.

Bug #44652

Change-Id: Ib882ba4ece08533e645e3eba6e9a78138f6c2787
Refactor the database schema for performance.

To use only the pages table to determine the next title to be processed,
store the latest claim (hash, timestamp and number of tries) and latest
score for each page.
Then, to get the next title query for the one with the highest score that
doesn't have its latest claim hash equal to the client's hash, except if 10min
have passed (in case of crashing clients).
Also:
- Add a direct reference to the latest result (in addition to the one to the
latest stat) to pages instead of going through claims.
- Remove claims table as it's no longer needed.
- Use (page id, commit hash) as the primary keys for results and stats, as
it allows using INSERT ... ON DUPLICATE KEY to avoid (improbable)
collisions.
- Clean up the code.
- Update the documentation.

Bug: 44652
Change-Id: I5800c99ce2d89c2984ed5376483cdf450f4333fe
Use a local settings file for rt-test server.js, add more options.

The round-trip test server will now read a server.settings.js file for its
options, including MySQL connection settings. The command line options
can still be used and they will override those present in the file.

There are also 3 new configuration parameters:
- 'tries' establishes the number of times a title is tested for a commit hash
before it's considered an error.
- 'fetches' sets the number of fetching errors that will be accepted before
the title is no longer considered for testing.
- 'cutofftime' represents, in seconds, the time to wait for a valid response
from a client.

Bug: 52114
Change-Id: If877269980931157ee2e94996edfa4e473a6f610
Get rid of top regressions / top fixes endpoints in round-trip test server.

Those endpoints are basically useless, as we always use pairwise
comparisons to find regressions. As a bonus, the regressions and fixes
counters now point to the comparisons between the two latest revisions.

Bug: 52235
Change-Id: I2ae6ce9fb089cc45eae6d05641c9b89d0aa04ba6
Provide @lh and latest result links on regressions and topfixes pages

Just some convenience links.
Bug: 52555
Change-Id: Id58f39426d21da7243d0f55b9c3e5cc4c78ef276
Record performance numbers during RT testing

Add a perfstats table to keep different performance metrics for each
page and commit. They are kept as key, value pairs so that it'll be easy to
add new stats in the future. The stats are passed from the client to the
server embedded in the test results, using a new tag.

There's also a very basic interface to view the stats at /perfstats.

Bug: 46659
Change-Id: If73731d53cf360b6a25b3d7bb2bc5c30a2a4e4b2
Don't try to insert perfstats if none given by client and no callback.

Change-Id: I33a7b691b6c7e56d8f807ecc69085b7fd60410dd
Merge remote-tracking branch 'origin/rt_testing' into master.

Conflicts:
	.jshintignore
	js/tests/roundtrip-test.js

Change-Id: Ia55278559c0edcbacef9bff8cb4913c07767d1e7