Skip to content

Commit

Permalink
Issue #272: Ensure that indexes are grouped together.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypha committed Sep 20, 2022
1 parent 8560fa3 commit 904c057
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
19 changes: 5 additions & 14 deletions classes/script_metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,15 @@ function ($i) {
}

/**
* Gets the name of the script.
* Gets the name of the script that is being run for the request.
*
* @return string the request path for this profile.
*/
public static function get_request(): string {
global $SCRIPT, $ME, $CFG;

if (!isset($ME)) {
// If set, it will trim off the leading '/' to normalise web & cli requests.
$request = isset($SCRIPT) ? ltrim($SCRIPT, '/') : self::REQUEST_UNKNOWN;
return $request;
}

$request = (new \moodle_url($ME))->out_omit_querystring();
$request = str_replace($CFG->wwwroot, '', $request);
$request = ltrim($request, '/');
return $request;
public static function get_request_script_name(): string {
global $SCRIPT;

// If set, it will trim off the leading '/' to normalise web & cli requests.
$request = isset($SCRIPT) ? ltrim($SCRIPT, '/') : self::REQUEST_UNKNOWN;
return $request;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/web_processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function init(manager $manager) {
// Record and set initial memory usage at this point.
$memoryusage = memory_get_usage();

$request = script_metadata::get_request();
$request = script_metadata::get_request_script_name();
$starttime = (int) $manager->get_starttime();
$this->sampleset = new sample_set($request, $starttime);

Expand Down

0 comments on commit 904c057

Please sign in to comment.