$profiler = Profiler::instance();
# Profiling must actually be enabled...
- if ( $profiler->isStub() ) {
+ if ( $profiler instanceof ProfilerStub ) {
return;
}
$isMaster = !is_null( $this->getLBInfo( 'master' ) );
$profiler = Profiler::instance();
- if ( !$profiler->isStub() ) {
+ if ( !$profiler instanceof ProfilerStub ) {
# generalizeSQL will probably cut down the query to reasonable
# logging size most of the time. The substr is really just a sanity check.
if ( $isMaster ) {
}
}
- /**
- * Return whether this a stub profiler
- *
- * @return bool
- */
- abstract public function isStub();
-
/**
* @param string $id
*/
public function logData() {
$output = isset( $this->params['output'] ) ? $this->params['output'] : null;
- if ( !$output || $this->isStub() ) {
+ if ( !$output || $this instanceof ProfilerStub ) {
// return early when no output classes defined or we're a stub
return;
}
}
}
- /**
- * Return whether this a stub profiler
- *
- * @return bool
- */
- public function isStub() {
- return false;
- }
-
/**
* Add the inital item in the stack.
*/
* @ingroup Profiler
*/
class ProfilerStub extends Profiler {
- public function isStub() {
- return true;
- }
-
public function profileIn( $fn ) {
}
$this->xhprof = new Xhprof( $params );
}
- public function isStub() {
- return false;
- }
-
/**
* No-op for xhprof profiling.
*