Merge branch 'dev' into PLAT-170
Adding a Bernoulli trial helper for event sampling.

This class provides an interface for sampling events at a given rate.
See http://en.wikipedia.org/wiki/Bernoulli_trial.
PLAT-170 Log sample of SQL queries w/ WikiaLogger.

Inserted random (at a rate of 1%) sampling of SQL queries in
DatabaseBase around doQuery. The instrumentation adds the query, the
execution time, the function, and the server role to the log payload.

With this in place, we can query using Kibana for the URL, the query
string, the server, the db name the calling method:function, and the
elapsed time.
Remove FIXME comment.
PLAT-170 Adding tests 4 changes to DatabaseBase.

Adding tests for the changes to DatabaseBase. I added a new path under
tests/unit/includes/db as this should be a proper unit test and so I
don't think belongs in tests/phpunit/includes/db/DatabaseTest.php. The
core tests are also broken and have unwanted side effects (like dropping
the users table).
PLAT-170 changed sample to shouldSample ...

Changed sample to shouldSample. I think this will improve the
readability where it's used.

Changed the range checking of the probability provided to a check that
will throw an exception.
PLAT-170 whitespace cleanup
Merge pull request #3787 from Wikia/PLAT-170

PLAT-170 Log sample of SQL queries w/ WikiaLogger