1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Modernize XHProf

Summary: Use modern components, pht

Test Plan: I have no data locally, expect @epriestley to commandeer

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11805
This commit is contained in:
Chad Little 2015-02-18 11:51:12 -08:00
parent 7f1914540f
commit 11f0c1a47d
4 changed files with 32 additions and 25 deletions

View file

@ -43,10 +43,13 @@ final class PhabricatorXHProfProfileController
$view->setIsFramed($is_framed);
$view->setProfileData($data);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('%s Profile', $symbol));
return $this->buildStandardPageResponse(
$view,
array($crumbs, $view),
array(
'title' => 'Profile',
'title' => pht('Profile'),
'frame' => $is_framed,
));
}

View file

@ -80,12 +80,15 @@ final class PhabricatorXHProfSampleListController
}
$list->setPager($pager);
$list->setNoDataString(pht('There are no profiling samples.'));
return $this->buildStandardPageResponse(
$list,
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('XHProf Samples'));
return $this->buildApplicationPage(
array($crumbs, $list),
array(
'title' => pht('XHProf Samples'),
'device' => true,
));
}

View file

@ -48,7 +48,7 @@ final class PhabricatorXHProfProfileSymbolView
$rows = array();
$rows[] = array(
'Metrics for this Call',
pht('Metrics for this Call'),
'',
'',
'',
@ -62,7 +62,7 @@ final class PhabricatorXHProfProfileSymbolView
));
$rows[] = array(
'Parent Calls',
pht('Parent Calls'),
'',
'',
'',
@ -79,7 +79,7 @@ final class PhabricatorXHProfProfileSymbolView
$rows[] = array(
'Child Calls',
pht('Child Calls'),
'',
'',
'',
@ -102,9 +102,9 @@ final class PhabricatorXHProfProfileSymbolView
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Symbol',
'Count',
'Wall Time',
pht('Symbol'),
pht('Count'),
pht('Wall Time'),
'%',
));
$table->setColumnClasses(
@ -115,8 +115,8 @@ final class PhabricatorXHProfProfileSymbolView
'n',
));
$panel = new AphrontPanelView();
$panel->setHeader('XHProf Profile');
$panel = new PHUIObjectBoxView();
$panel->setHeader(pht('XHProf Profile'));
$panel->appendChild($table);
return $panel->render();

View file

@ -54,7 +54,7 @@ final class PhabricatorXHProfProfileTopLevelView
$rows = array();
$rows[] = array(
'Total',
pht('Total'),
number_format($totals['ct']),
number_format($totals['wt']).' us',
'100.0%',
@ -82,16 +82,16 @@ final class PhabricatorXHProfProfileTopLevelView
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Symbol',
'Count',
pht('Symbol'),
pht('Count'),
javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
'meta' => array(
'tip' => 'Total wall time spent in this function and all of '.
'tip' => pht('Total wall time spent in this function and all of '.
'its children (children are other functions it called '.
'while executing).',
'while executing).'),
'size' => 200,
),
),
@ -102,9 +102,9 @@ final class PhabricatorXHProfProfileTopLevelView
array(
'sigil' => 'has-tooltip',
'meta' => array(
'tip' => 'Wall time spent in this function, excluding time '.
'tip' => pht('Wall time spent in this function, excluding time '.
'spent in children (children are other functions it '.
'called while executing).',
'called while executing).'),
'size' => 200,
),
),
@ -121,18 +121,19 @@ final class PhabricatorXHProfProfileTopLevelView
'n',
));
$panel = new AphrontPanelView();
$panel->setHeader('XHProf Profile');
$panel = new PHUIObjectBoxView();
$header = id(new PHUIHeaderView())
->setHeaderText(pht('XHProf Profile'));
if ($this->file) {
$panel->addButton(
phutil_tag(
$button = phutil_tag(
'a',
array(
'href' => $this->file->getBestURI(),
'class' => 'green button',
),
'Download .xhprof Profile'));
pht('Download .xhprof Profile'));
$header->addActionLink($button);
}
$panel->appendChild($table);