Timing::measure(): handle missing marks better
authorOri Livneh <ori@wikimedia.org>
Thu, 10 Dec 2015 22:58:11 +0000 (14:58 -0800)
committerOri Livneh <ori@wikimedia.org>
Thu, 10 Dec 2015 22:58:11 +0000 (14:58 -0800)
commit54f9e1f159ae747f81fc7a5886da77fde8025adf
tree5fdab9ed5f7f687b948c9e9d904df6b019b68759
parent922d05c75cf771431bb98c17eb94dfd39e72f413
Timing::measure(): handle missing marks better

Currently Timing::measure() does not check that the requested start and end
marks exist, causing it to return bogus values without any indication that
something has gone wrong. Fix this by logging and error and returning false
in case either the start or end markers do not exist. To make it possible to
log, make Timing implement the LoggerAware interface.

Change-Id: I75af5273e9a8a52b31d0af1de206b0d8a4c82fbc
includes/context/RequestContext.php
includes/libs/Timing.php