mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Update XHProf for handleRequest
Summary: Updates XHProf for handleRequest Test Plan: Use XHProf Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T8628 Differential Revision: https://secure.phabricator.com/D13770
This commit is contained in:
parent
6d59f3d1f2
commit
eea94aaf67
2 changed files with 11 additions and 19 deletions
|
@ -3,22 +3,16 @@
|
||||||
final class PhabricatorXHProfProfileController
|
final class PhabricatorXHProfProfileController
|
||||||
extends PhabricatorXHProfController {
|
extends PhabricatorXHProfController {
|
||||||
|
|
||||||
private $phid;
|
|
||||||
|
|
||||||
public function shouldAllowPublic() {
|
public function shouldAllowPublic() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$this->phid = $data['phid'];
|
$phid = $request->getURIData('phid');
|
||||||
}
|
|
||||||
|
|
||||||
public function processRequest() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
|
|
||||||
$file = id(new PhabricatorFileQuery())
|
$file = id(new PhabricatorFileQuery())
|
||||||
->setViewer($request->getUser())
|
->setViewer($request->getUser())
|
||||||
->withPHIDs(array($this->phid))
|
->withPHIDs(array($phid))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
|
|
|
@ -3,24 +3,22 @@
|
||||||
final class PhabricatorXHProfSampleListController
|
final class PhabricatorXHProfSampleListController
|
||||||
extends PhabricatorXHProfController {
|
extends PhabricatorXHProfController {
|
||||||
|
|
||||||
private $view;
|
|
||||||
|
|
||||||
public function shouldAllowPublic() {
|
public function shouldAllowPublic() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$this->view = idx($data, 'view', 'all');
|
$viewer = $request->getViewer();
|
||||||
}
|
$view = $request->getURIData('view');
|
||||||
|
|
||||||
public function processRequest() {
|
if (!$view) {
|
||||||
$request = $this->getRequest();
|
$view = 'all';
|
||||||
$user = $request->getUser();
|
}
|
||||||
|
|
||||||
$pager = new PHUIPagerView();
|
$pager = new PHUIPagerView();
|
||||||
$pager->setOffset($request->getInt('page'));
|
$pager->setOffset($request->getInt('page'));
|
||||||
|
|
||||||
switch ($this->view) {
|
switch ($view) {
|
||||||
case 'sampled':
|
case 'sampled':
|
||||||
$clause = 'sampleRate > 0';
|
$clause = 'sampleRate > 0';
|
||||||
$show_type = false;
|
$show_type = false;
|
||||||
|
@ -78,7 +76,7 @@ final class PhabricatorXHProfSampleListController
|
||||||
|
|
||||||
$item->addIcon(
|
$item->addIcon(
|
||||||
'none',
|
'none',
|
||||||
phabricator_datetime($sample->getDateCreated(), $user));
|
phabricator_datetime($sample->getDateCreated(), $viewer));
|
||||||
|
|
||||||
$list->addItem($item);
|
$list->addItem($item);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue