Commit c3d3a60c authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

added statistics to response times

parent 1a51b99f
......@@ -153,9 +153,13 @@ class RequestFetcher extends Command
$infos = explode(";", $infos);
$resulthash = $infos[0];
$cacheDurationMinutes = intval($infos[1]);
$name = $infos[2];
$responseCode = curl_getinfo($info["handle"], CURLINFO_HTTP_CODE);
$body = "";
$totalTime = curl_getinfo($info["handle"], CURLINFO_TOTAL_TIME);
\App\PrometheusExporter::Duration($totalTime, $name);
$error = curl_error($info["handle"]);
if (!empty($error)) {
Log::error($error);
......@@ -192,7 +196,7 @@ class RequestFetcher extends Command
curl_setopt_array($ch, array(
CURLOPT_URL => $job["url"],
CURLOPT_PRIVATE => $job["resulthash"] . ";" . $job["cacheDuration"],
CURLOPT_PRIVATE => $job["resulthash"] . ";" . $job["cacheDuration"] . ";" . $job["name"],
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERAGENT => $job["useragent"],
CURLOPT_FOLLOWLOCATION => true,
......
......@@ -375,7 +375,7 @@ class MetaGer
$publicKey = getenv('adgoal_public');
$privateKey = getenv('adgoal_private');
if ($publicKey === false) {
return $results;
return null;
}
$tldList = "";
foreach ($results as $result) {
......@@ -393,7 +393,7 @@ class MetaGer
# Hashwert
$hash = md5("meta" . $publicKey . $tldList . "GER");
# Query
$query = $this->q;
......@@ -408,6 +408,7 @@ class MetaGer
"password" => null,
"headers" => null,
"cacheDuration" => 60,
"name" => "Adgoal",
];
$mission = json_encode($mission);
Redis::rpush(\App\MetaGer::FETCHQUEUE_KEY, $mission);
......
......@@ -149,6 +149,7 @@ abstract class Searchengine
"password" => $this->password,
"headers" => $this->headers,
"cacheDuration" => $this->cacheDuration,
"name" => $this->name
];
$mission = json_encode($mission);
......
Supports Markdown
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