<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">${sitepath}/mod/forum/post.php</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+ <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
$performanceinfo = $perf['html'];
}
}
+
+ // We always want performance data when running a performance test, even if the user is redirected to another page.
+ if (MDL_PERF_TEST && strpos($footer, $this->unique_performance_info_token) === false) {
+ $footer = $this->unique_performance_info_token . $footer;
+ }
$footer = str_replace($this->unique_performance_info_token, $performanceinfo, $footer);
$footer = str_replace($this->unique_end_html_token, $this->page->requires->get_end_code(), $footer);
define('PHPUNIT_TEST', false);
}
+// Performance tests needs to always display performance info, even in redirections.
+if (!defined('MDL_PERF_TEST')) {
+ define('MDL_PERF_TEST', false);
+} else {
+ // We force the ones we need.
+ if (!defined('MDL_PERF')) {
+ define('MDL_PERF', true);
+ }
+ if (!defined('MDL_PERFDB')) {
+ define('MDL_PERFDB', true);
+ }
+ if (!defined('MDL_PERFTOFOOT')) {
+ define('MDL_PERFTOFOOT', true);
+ }
+}
+
// When set to true MUC (Moodle caching) will be disabled as much as possible.
// A special cache factory will be used to handle this situation and will use special "disabled" equivalents objects.
// This ensure we don't attempt to read or create the config file, don't use stores, don't provide persistence or
$htmllang = '';
}
+ $footer = '';
+ if (MDL_PERF_TEST) {
+ $perfinfo = get_performance_info();
+ $footer = '<footer>' . $perfinfo['html'] . '</footer>';
+ }
+
return '<!DOCTYPE html>
<html ' . $htmllang . '>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
'.$meta.'
<title>' . $title . '</title>
-</head><body>' . $content . '</body></html>';
+</head><body>' . $content . $footer . '</body></html>';
}
}