Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -52,12 +52,22 @@ |
53 | 53 | public abstract function execute(); |
54 | 54 | |
55 | 55 | /** |
56 | | - * Get the name of the query being executed by this instance |
| 56 | + * Get the name of the module being executed by this instance |
57 | 57 | */ |
58 | 58 | public function getModuleName() { |
59 | 59 | return $this->mModuleName; |
60 | 60 | } |
61 | 61 | |
| 62 | + /** |
| 63 | + * Get the name of the module as shown in the profiler log |
| 64 | + */ |
| 65 | + public function getModuleProfileName($db = false) { |
| 66 | + if ($db) |
| 67 | + return 'API:' . $this->mModuleName . '-DB'; |
| 68 | + else |
| 69 | + return 'API:' . $this->mModuleName; |
| 70 | + } |
| 71 | + |
62 | 72 | /** |
63 | 73 | * Get main module |
64 | 74 | */ |
— | — | @@ -394,7 +404,7 @@ |
395 | 405 | if ($this->mTimeIn !== 0) |
396 | 406 | ApiBase :: dieDebug(__METHOD__, 'called twice without calling profileOut()'); |
397 | 407 | $this->mTimeIn = microtime(true); |
398 | | - wfProfileIn($this->getModuleName()); |
| 408 | + wfProfileIn($this->getModuleProfileName()); |
399 | 409 | } |
400 | 410 | |
401 | 411 | /** |
— | — | @@ -408,7 +418,7 @@ |
409 | 419 | |
410 | 420 | $this->mModuleTime += microtime(true) - $this->mTimeIn; |
411 | 421 | $this->mTimeIn = 0; |
412 | | - wfProfileOut($this->getModuleName()); |
| 422 | + wfProfileOut($this->getModuleProfileName()); |
413 | 423 | } |
414 | 424 | |
415 | 425 | /** |
— | — | @@ -434,7 +444,7 @@ |
435 | 445 | if ($this->mDBTimeIn !== 0) |
436 | 446 | ApiBase :: dieDebug(__METHOD__, 'called twice without calling profileDBOut()'); |
437 | 447 | $this->mDBTimeIn = microtime(true); |
438 | | - wfProfileIn($this->getModuleName() . '_db'); |
| 448 | + wfProfileIn($this->getModuleProfileName(true)); |
439 | 449 | } |
440 | 450 | |
441 | 451 | /** |
— | — | @@ -451,7 +461,7 @@ |
452 | 462 | |
453 | 463 | $this->mDBTime += $time; |
454 | 464 | $this->getMain()->mDBTime += $time; |
455 | | - wfProfileOut($this->getModuleName() . '_db'); |
| 465 | + wfProfileOut($this->getModuleProfileName(true)); |
456 | 466 | } |
457 | 467 | |
458 | 468 | /** |