Skip to content
Snippets Groups Projects
Commit 50d230f0 authored by Laurent's avatar Laurent
Browse files

improve_search_performance

add monitoring script
parent c600a0d9
Branches
Tags
2 merge requests!1146Dev#29558 improve search performances,!1130Dev#29558 improve search performances
<?php
error_reporting(E_ALL^E_DEPRECATED);
function new_recherche($expression_recherchee){
if (!isset($argv[1])) {
echo 'I need bokeh URL !!';
exit(1);
}
function new_recherche($expression_recherchee, $url){
$cookie_file = tempnam("/tmp", "cookie");
$url_recherche = "http://opacce.pergame.net/opacce.pergame.net/recherche/simple/expressionRecherche/";
$url_recherche = $url . '/recherche/simple/expressionRecherche/';
$curl_old_step_1 = curl_init($url_recherche.$expression_recherchee);
curl_setopt($curl_old_step_1,CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($curl_old_step_1,CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($curl_old_step_1,CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($curl_old_step_1,CURLOPT_RETURNTRANSFER, true);
$result_old_step_1 = curl_exec($curl_old_step_1);
$total_time = curl_getinfo($curl_old_step_1,CURLINFO_TOTAL_TIME );
curl_close($curl_old_step_1);
if (false == strpos($result_old_step_1, 'Recherche: '.$expression_recherchee)) {
echo "Error\n";
}
echo date("H:i:s")." : $total_time s\n";
echo date("H:i:s")." : $total_time s [$expression_recherchee]\n";
return $total_time;
}
// main
while(true) {
foreach(['sport', 'france', 'pomme', 'informatique'] as $terme) {
new_recherche($terme);
foreach(['sport',
'france',
'pomme',
'informatique',
'plaine',
'poire',
'histoire',
'camille',
'mysql',
'ukulélé',
'minion',
'partition',
'musique',
'théatre',
'cinéma'] as $terme) {
new_recherche($terme, $argv[1]);
sleep(5);
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment