Add StatsD metric logging
[lhc/web/wiklou.git] / includes / context / DerivativeContext.php
index 836aef9..00323ca 100644 (file)
@@ -97,6 +97,19 @@ class DerivativeContext extends ContextSource {
                }
        }
 
+       /**
+        * Get the stats object
+        *
+        * @return BufferingStatsdDataFactory
+        */
+       public function getStats() {
+               if ( !is_null( $this->stats ) ) {
+                       return $this->stats;
+               } else {
+                       return $this->getContext()->getStats();
+               }
+       }
+
        /**
         * Set the WebRequest object
         *