Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorDeveloperConfigOptions.php
<?php | <?php | ||||
final class PhabricatorDeveloperConfigOptions | final class PhabricatorDeveloperConfigOptions | ||||
extends PhabricatorApplicationConfigOptions { | extends PhabricatorApplicationConfigOptions { | ||||
public function getName() { | public function getName() { | ||||
return pht('Developer / Debugging'); | return pht('Developer / Debugging'); | ||||
} | } | ||||
public function getDescription() { | public function getDescription() { | ||||
return pht('Options for Phabricator developers, including debugging.'); | return pht('Options for platform developers, including debugging.'); | ||||
} | } | ||||
public function getIcon() { | public function getIcon() { | ||||
return 'fa-bug'; | return 'fa-bug'; | ||||
} | } | ||||
public function getGroup() { | public function getGroup() { | ||||
return 'core'; | return 'core'; | ||||
} | } | ||||
public function getOptions() { | public function getOptions() { | ||||
return array( | return array( | ||||
$this->newOption('darkconsole.enabled', 'bool', false) | $this->newOption('darkconsole.enabled', 'bool', false) | ||||
->setBoolOptions( | ->setBoolOptions( | ||||
array( | array( | ||||
pht('Enable DarkConsole'), | pht('Enable DarkConsole'), | ||||
pht('Disable DarkConsole'), | pht('Disable DarkConsole'), | ||||
)) | )) | ||||
->setSummary(pht("Enable Phabricator's debugging console.")) | ->setSummary(pht('Enable the debugging console.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"DarkConsole is a development and profiling tool built into ". | "DarkConsole is a development and profiling tool built into ". | ||||
"Phabricator's web interface. You should leave it disabled unless ". | "the web interface. You should leave it disabled unless ". | ||||
"you are developing or debugging Phabricator.\n\n". | "you are developing or debugging %s.\n\n". | ||||
"Once you activate DarkConsole for the install, **you need to ". | "Once you activate DarkConsole for the install, **you need to ". | ||||
"enable it for your account before it will actually appear on ". | "enable it for your account before it will actually appear on ". | ||||
"pages.** You can do this in Settings > Developer Settings.\n\n". | "pages.** You can do this in Settings > Developer Settings.\n\n". | ||||
"DarkConsole exposes potentially sensitive data (like queries, ". | "DarkConsole exposes potentially sensitive data (like queries, ". | ||||
"stack traces, and configuration) so you generally should not ". | "stack traces, and configuration) so you generally should not ". | ||||
"turn it on in production.")), | "turn it on in production.", | ||||
PlatformSymbols::getPlatformServerName())), | |||||
$this->newOption('darkconsole.always-on', 'bool', false) | $this->newOption('darkconsole.always-on', 'bool', false) | ||||
->setBoolOptions( | ->setBoolOptions( | ||||
array( | array( | ||||
pht('Always Activate DarkConsole'), | pht('Always Activate DarkConsole'), | ||||
pht('Require DarkConsole Activation'), | pht('Require DarkConsole Activation'), | ||||
)) | )) | ||||
->setSummary(pht('Activate DarkConsole on every page.')) | ->setSummary(pht('Activate DarkConsole on every page.')) | ||||
->setDescription( | ->setDescription( | ||||
Show All 36 Lines | return array( | ||||
pht('Stop Before HTTP Redirect'), | pht('Stop Before HTTP Redirect'), | ||||
pht('Use Normal HTTP Redirects'), | pht('Use Normal HTTP Redirects'), | ||||
)) | )) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'Confirm before redirecting so DarkConsole can be examined.')) | 'Confirm before redirecting so DarkConsole can be examined.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Normally, Phabricator issues HTTP redirects after a successful '. | 'Normally, this software issues HTTP redirects after a successful '. | ||||
'POST. This can make it difficult to debug things which happen '. | 'POST. This can make it difficult to debug things which happen '. | ||||
'while processing the POST, because service and profiling '. | 'while processing the POST, because service and profiling '. | ||||
'information are lost. By setting this configuration option, '. | 'information are lost. By setting this configuration option, '. | ||||
'Phabricator will show a page instead of automatically '. | 'an interstitial page will be shown instead of automatically '. | ||||
'redirecting, allowing you to examine service and profiling '. | 'redirecting, allowing you to examine service and profiling '. | ||||
'information. It also makes the UX awful, so you should only '. | 'information. It also makes the UX awful, so you should only '. | ||||
'enable it when debugging.')), | 'enable it when debugging.')), | ||||
$this->newOption('debug.profile-rate', 'int', 0) | $this->newOption('debug.profile-rate', 'int', 0) | ||||
->addExample(0, pht('No profiling')) | ->addExample(0, pht('No profiling')) | ||||
->addExample(1, pht('Profile every request (slow)')) | ->addExample(1, pht('Profile every request (slow)')) | ||||
->addExample(1000, pht('Profile 0.1%% of all requests')) | ->addExample(1000, pht('Profile 0.1%% of all requests')) | ||||
->setSummary(pht('Automatically profile some percentage of pages.')) | ->setSummary(pht('Automatically profile some percentage of pages.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"Normally, Phabricator profiles pages only when explicitly ". | "Normally, pages are profiled only when explicitly ". | ||||
"requested via DarkConsole. However, it may be useful to profile ". | "requested via DarkConsole. However, it may be useful to profile ". | ||||
"some pages automatically.\n\n". | "some pages automatically.\n\n". | ||||
"Set this option to a positive integer N to profile 1 / N pages ". | "Set this option to a positive integer N to profile 1 / N pages ". | ||||
"automatically. For example, setting it to 1 will profile every ". | "automatically. For example, setting it to 1 will profile every ". | ||||
"page, while setting it to 1000 will profile 1 page per 1000 ". | "page, while setting it to 1000 will profile 1 page per 1000 ". | ||||
"requests (i.e., 0.1%% of requests).\n\n". | "requests (i.e., 0.1%% of requests).\n\n". | ||||
"Since profiling is slow and generates a lot of data, you should ". | "Since profiling is slow and generates a lot of data, you should ". | ||||
"set this to 0 in production (to disable it) or to a large number ". | "set this to 0 in production (to disable it) or to a large number ". | ||||
"(to collect a few samples, if you're interested in having some ". | "(to collect a few samples, if you're interested in having some ". | ||||
"data to look at eventually). In development, it may be useful to ". | "data to look at eventually). In development, it may be useful to ". | ||||
"set it to 1 in order to debug performance problems.\n\n". | "set it to 1 in order to debug performance problems.\n\n". | ||||
"NOTE: You must install XHProf for profiling to work.")), | "NOTE: You must install XHProf for profiling to work.")), | ||||
$this->newOption('debug.sample-rate', 'int', 1000) | $this->newOption('debug.sample-rate', 'int', 1000) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->addExample(0, pht('No performance sampling.')) | ->addExample(0, pht('No performance sampling.')) | ||||
->addExample(1, pht('Sample every request (slow).')) | ->addExample(1, pht('Sample every request (slow).')) | ||||
->addExample(1000, pht('Sample 0.1%% of requests.')) | ->addExample(1000, pht('Sample 0.1%% of requests.')) | ||||
->setSummary(pht('Automatically sample some fraction of requests.')) | ->setSummary(pht('Automatically sample some fraction of requests.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"The Multimeter application collects performance samples. You ". | "The Multimeter application collects performance samples. You ". | ||||
"can use this data to help you understand what Phabricator is ". | "can use this data to help you understand what the software is ". | ||||
"spending time and resources doing, and to identify problematic ". | "spending time and resources doing, and to identify problematic ". | ||||
"access patterns.". | "access patterns.". | ||||
"\n\n". | "\n\n". | ||||
"This option controls how frequently sampling activates. Set it ". | "This option controls how frequently sampling activates. Set it ". | ||||
"to some positive integer N to sample every 1 / N pages.". | "to some positive integer N to sample every 1 / N pages.". | ||||
"\n\n". | "\n\n". | ||||
"For most installs, the default value (1 sample per 1000 pages) ". | "For most installs, the default value (1 sample per 1000 pages) ". | ||||
"should collect enough data to be useful without requiring much ". | "should collect enough data to be useful without requiring much ". | ||||
Show All 18 Lines |