Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the format of the url so it is easier to copy and paste out #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docroot/index-perf.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
$time_start = microtime( true );

register_shutdown_function(function() use ($time_start, $profiler_namespace, $benchmark_url, $profiler_extra) {
// Get docroot because adding it manually to the href is annoying.
$docroot = '';
if (isset($_GET['docroot'])) {
$docroot = 'http://' . $_GET['docroot'];
}

$time_end = ( microtime( true ) - $time_start );
printf( "loop time: |%fs|",
$time_end
Expand All @@ -50,7 +56,7 @@

// url to the XHProf UI libraries (change the host name and path)
$profiler_url = sprintf($base_url . '/xhprof-kit/xhprof/xhprof_html/index.php?source=%s&url=%s&run=%s&extra=%s', $profiler_namespace, urlencode($benchmark_url), $run_id, $profiler_extra);
echo $run_id . '|' . $profiler_namespace . '|' . $profiler_extra . '|' . '<a href="'. $profiler_url .'" target="_blank">Profiler output</a>' . "\n";
echo $run_id . '|' . $profiler_namespace . '|' . $profiler_extra . '|' . $docroot . $profiler_url . "\n";
}

});
Expand Down
4 changes: 2 additions & 2 deletions find-min-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ RUN_COLLECTOR=""
[ -n "$4" ] && RUN_COLLECTOR=$4

# Do one call to ensure caches are primed.
curl -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -s 'http://'"$XHPROF_KIT_DOCROOT"'/index-perf.php?extra='"$NS"'&url='"$URL" | grep 'loop time: |' &>/dev/null
curl -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -s 'http://'"$XHPROF_KIT_DOCROOT"'/index-perf.php?extra='"$NS"'&url='"$URL"'&docroot='"$XHPROF_KIT_DOCROOT" | grep 'loop time: |' &>/dev/null

for i in $(seq 1 $LOOPS)
do
curl -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -s 'http://'"$XHPROF_KIT_DOCROOT"'/index-perf.php?extra='"$NS"'&url='"$URL" | grep 'loop time: |'
curl -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -s 'http://'"$XHPROF_KIT_DOCROOT"'/index-perf.php?extra='"$NS"'&url='"$URL"'&docroot='"$XHPROF_KIT_DOCROOT" | grep 'loop time: |'
done | while read line
do
mytime=$(echo $line | cut -d'|' -f2 | cut -d's' -f1 | sed 's/^/1000*1000*/' | bc | cut -d'.' -f1)
Expand Down