public abstract function execute();
/**
- * Get the name of the query being executed by this instance
+ * Get the name of the module being executed by this instance
*/
public function getModuleName() {
return $this->mModuleName;
}
+ /**
+ * Get the name of the module as shown in the profiler log
+ */
+ public function getModuleProfileName($db = false) {
+ if ($db)
+ return 'API:' . $this->mModuleName . '-DB';
+ else
+ return 'API:' . $this->mModuleName;
+ }
+
/**
* Get main module
*/
if ($this->mTimeIn !== 0)
ApiBase :: dieDebug(__METHOD__, 'called twice without calling profileOut()');
$this->mTimeIn = microtime(true);
- wfProfileIn($this->getModuleName());
+ wfProfileIn($this->getModuleProfileName());
}
/**
$this->mModuleTime += microtime(true) - $this->mTimeIn;
$this->mTimeIn = 0;
- wfProfileOut($this->getModuleName());
+ wfProfileOut($this->getModuleProfileName());
}
/**
if ($this->mDBTimeIn !== 0)
ApiBase :: dieDebug(__METHOD__, 'called twice without calling profileDBOut()');
$this->mDBTimeIn = microtime(true);
- wfProfileIn($this->getModuleName() . '_db');
+ wfProfileIn($this->getModuleProfileName(true));
}
/**
$this->mDBTime += $time;
$this->getMain()->mDBTime += $time;
- wfProfileOut($this->getModuleName() . '_db');
+ wfProfileOut($this->getModuleProfileName(true));
}
/**