Throw Exceptions on preg_* failures in MagicWordArray::matchAndRemove()
[lhc/web/wiklou.git] / includes / objectcache / ObjectCacheSessionHandler.php
index 1f4beb9..2a5d695 100644 (file)
@@ -108,7 +108,11 @@ class ObjectCacheSessionHandler {
         * @return mixed Session data
         */
        static function read( $id ) {
+               $stime = microtime( true );
                $data = self::getCache()->get( self::getKey( $id ) );
+               $real = microtime( true ) - $stime;
+
+               RequestContext::getMain()->getStats()->timing( "session.read", 1000 * $real );
 
                self::$hashCache = array( $id => self::getHash( $data ) );
 
@@ -129,7 +133,11 @@ class ObjectCacheSessionHandler {
                if ( !isset( self::$hashCache[$id] )
                        || self::getHash( $data ) !== self::$hashCache[$id]
                ) {
+                       $stime = microtime( true );
                        self::getCache()->set( self::getKey( $id ), $data, $wgObjectCacheSessionExpiry );
+                       $real = microtime( true ) - $stime;
+
+                       RequestContext::getMain()->getStats()->timing( "session.write", 1000 * $real );
                }
 
                return true;
@@ -142,7 +150,11 @@ class ObjectCacheSessionHandler {
         * @return bool Success
         */
        static function destroy( $id ) {
+               $stime = microtime( true );
                self::getCache()->delete( self::getKey( $id ) );
+               $real = microtime( true ) - $stime;
+
+               RequestContext::getMain()->getStats()->timing( "session.destroy", 1000 * $real );
 
                return true;
        }