} } $termCount = count($terminate); $counts["{$region}.{$ami}"] = $count - $termCount; // figure out what the target number of testers for this location is // if we have any idle testers them plan to eliminate them // otherwise, increase the number until we kit the expected backlog echo "Active: {$activeCount}\n"; echo "Idle: {$idleCount}\n"; echo "Offline: {$offlineCount}\n"; $targetCount = $activeCount; if ($idleCount) { // $targetCount = (int)($activeCount + ($idleCount / 4)); } elseif ($targetBacklog) { // get the current backlog $backlog = GetPendingTests($location, $bk, $avgTime); echo "Backlog: {$backlog}\n"; if ($activeCount) { $ratio = $backlog / $activeCount; } if (!$activeCount || $ratio > $targetBacklog) { $targetCount = (int) ($backlog / $targetBacklog); } echo "Target from Backlog: {$targetCount}\n"; } $targetCount = max(min($targetCount, $regionData['max']), $regionData['min']); if ($targetCount > $regionData['min']) { $minimum = false; } echo "Target: {$targetCount} (max = {$regionData['max']}, min = {$regionData['min']})\n"; $needed = $targetCount - $counts["{$region}.{$ami}"];
/** * Load the location information * */ function LoadLocations() { $locations = LoadLocationsIni(); FilterLocations($locations, 'pss'); // strip out any sensitive information foreach ($locations as $index => &$loc) { if (isset($loc['browser'])) { $testCount = 16; if (array_key_exists('relayServer', $loc)) { $loc['backlog'] = 0; $loc['avgTime'] = 30; $loc['testers'] = 1; $loc['wait'] = ceil($testCount * 30 / 60); } else { GetPendingTests($index, $count, $avgTime); if (!$avgTime) { $avgTime = 30; } // default to 30 seconds if we don't have any history $loc['backlog'] = $count; $loc['avgTime'] = $avgTime; $loc['testers'] = GetTesterCount($index); $loc['wait'] = -1; if ($loc['testers']) { if ($loc['testers'] > 1) { $testCount = 16; } $loc['wait'] = ceil(($testCount + $count / $loc['testers']) * $avgTime / 60); } } } unset($loc['localDir']); unset($loc['key']); unset($loc['remoteDir']); unset($loc['relayKey']); } return $locations; }
/** * Load the location information * */ function LoadLocations() { $locations = parse_ini_file('./settings/locations.ini', true); FilterLocations($locations, 'blink', array('IE', '6', '7', '8', '9', 'dynaTrace')); //FilterLocations( $locations); // strip out any sensitive information foreach ($locations as $index => &$loc) { if (isset($loc['browser'])) { GetPendingTests($index, $count, $avgTime); if (!$avgTime) { $avgTime = 30; } // default to 30 seconds if we don't have any history $loc['backlog'] = $count; $loc['avgTime'] = $avgTime; $loc['testers'] = GetTesterCount($index); $loc['wait'] = -1; if ($loc['testers']) { $testCount = 20; if ($loc['testers'] > 1) { $testCount = 10; } $loc['wait'] = ceil(($testCount + $count / $loc['testers']) * $avgTime / 60); } } unset($loc['localDir']); unset($loc['key']); unset($loc['remoteDir']); } return $locations; }
/** * Load the location information * */ function LoadLocations() { $locations = parse_ini_file('./settings/locations.ini', true); // only include the mobile browsers foreach ($locations as $index => &$loc) { if (array_key_exists('browser', $loc)) { if (!array_key_exists('type', $loc) || stripos($loc['type'], 'nodejs') === false && stripos($loc['type'], 'mobile') == false) { unset($locations[$index]); } } } FilterLocations($locations, 'pss'); // strip out any sensitive information foreach ($locations as $index => &$loc) { if (isset($loc['browser'])) { $testCount = 26; if (array_key_exists('relayServer', $loc)) { $loc['backlog'] = 0; $loc['avgTime'] = 30; $loc['testers'] = 1; $loc['wait'] = ceil($testCount * 30 / 60); } else { GetPendingTests($index, $count, $avgTime); if (!$avgTime) { $avgTime = 30; } // default to 30 seconds if we don't have any history $loc['backlog'] = $count; $loc['avgTime'] = $avgTime; $loc['testers'] = GetTesterCount($index); $loc['wait'] = -1; if ($loc['testers']) { if ($loc['testers'] > 1) { $testCount = 16; } $loc['wait'] = ceil(($testCount + $count / $loc['testers']) * $avgTime / 60); } } } unset($loc['localDir']); unset($loc['key']); unset($loc['remoteDir']); unset($loc['relayKey']); } return $locations; }
} } $termCount = count($terminate); $counts["{$region}.{$ami}"] = $count - $termCount; // figure out what the target number of testers for this location is // if we have any idle testers them plan to eliminate them // otherwise, increase the number until we kit the expected backlog echo "Active: {$activeCount}\n"; echo "Idle: {$idleCount}\n"; echo "Offline: {$offlineCount}\n"; $targetCount = $activeCount; if ($idleCount) { // $targetCount = (int)($activeCount + ($idleCount / 4)); } elseif ($targetBacklog) { // get the current backlog $backlog = GetPendingTests($location, $bk); echo "Backlog: {$backlog}\n"; if ($activeCount) { $ratio = $backlog / $activeCount; } if (!$activeCount || $ratio > $targetBacklog) { $targetCount = (int) ($backlog / $targetBacklog); } echo "Target from Backlog: {$targetCount}\n"; } $targetCount = max(min($targetCount, $regionData['max']), $regionData['min']); if ($targetCount > $regionData['min']) { $minimum = false; } echo "Target: {$targetCount} (max = {$regionData['max']}, min = {$regionData['min']})\n"; $needed = $targetCount - $counts["{$region}.{$ami}"];