Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFD239210 for ; Sun, 8 Apr 2012 01:57:18 +0000 (UTC) Received: (qmail 49165 invoked by uid 500); 8 Apr 2012 01:57:18 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 49131 invoked by uid 500); 8 Apr 2012 01:57:18 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 49124 invoked by uid 99); 8 Apr 2012 01:57:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2012 01:57:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2012 01:57:15 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D6E552388847 for ; Sun, 8 Apr 2012 01:56:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r811917 - in /websites/staging/ooo-site/trunk: cgi-bin/ content/ content/download/test/download_new_dl.js content/download/test/globalvars_new_dl.js Date: Sun, 08 Apr 2012 01:56:53 -0000 To: ooo-commits@incubator.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120408015653.D6E552388847@eris.apache.org> Author: buildbot Date: Sun Apr 8 01:56:53 2012 New Revision: 811917 Log: Staging update by buildbot for openofficeorg Modified: websites/staging/ooo-site/trunk/cgi-bin/ (props changed) websites/staging/ooo-site/trunk/content/ (props changed) websites/staging/ooo-site/trunk/content/download/test/download_new_dl.js websites/staging/ooo-site/trunk/content/download/test/globalvars_new_dl.js Propchange: websites/staging/ooo-site/trunk/cgi-bin/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sun Apr 8 01:56:53 2012 @@ -1 +1 @@ -1310906 +1310936 Propchange: websites/staging/ooo-site/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sun Apr 8 01:56:53 2012 @@ -1 +1 @@ -1310906 +1310936 Modified: websites/staging/ooo-site/trunk/content/download/test/download_new_dl.js ============================================================================== --- websites/staging/ooo-site/trunk/content/download/test/download_new_dl.js (original) +++ websites/staging/ooo-site/trunk/content/download/test/download_new_dl.js Sun Apr 8 01:56:53 2012 @@ -35,25 +35,28 @@ function getMirrorHost() { // Are Apache mirrors working? if ( MIRROR_ASF_ACTIVE > 0 ) { mirrorHost = "Apache"; + } // Else are SourceForge mirrors working? - } else if ( MIRROR_SF_ACTIVE > 0 ) { + else if ( MIRROR_SF_ACTIVE > 0 ) { mirrorHost = "SourceForge"; + } // None is working, we have a problem - } else { + else { mirrorHost = "No mirror host active, what to do?"; } - document.write( "Fall back download goes to: " + mirrorHost + "

" ); + document.write( "Fall back download goes to: " + mirrorHost + "
" ); + document.write( "
" ); } return mirrorHost; } function getMirrorHost_asf_sf_mb_percent() { - var mirrorHost = ""; - var randVal = ( Math.random() * 100 ); + var mirrorHost = ""; + var randVal = ( Math.random() * 100 ); var MIRROR_RATIO = MIRROR_RATIO_2; document.write( "ASF is active: " + MIRROR_ASF_ACTIVE + "
" ); @@ -84,6 +87,7 @@ function getMirrorHost_asf_sf_mb_percent mirrorHost = "MirrorBrain"; } } + document.write( "Regular download goes to: " + mirrorHost + "
" ); // Defining fall back mirror host @@ -91,34 +95,96 @@ function getMirrorHost_asf_sf_mb_percent // Are Apache mirrors working? if ( MIRROR_ASF_ACTIVE > 0 ) { mirrorHost = "Apache"; + } // Else are SourceForge mirrors working? - } else if ( MIRROR_SF_ACTIVE > 0 ) { + else if ( MIRROR_SF_ACTIVE > 0 ) { mirrorHost = "SourceForge"; + } // Else are MirrorBrain mirrors working? - } else if ( MIRROR_MB_ACTIVE > 0 ) { + else if ( MIRROR_MB_ACTIVE > 0 ) { mirrorHost = "MirrorBrain"; + } // None is working, we have a problem - } else { + else { mirrorHost = "None, what to do?"; } - document.write( "Fall back download goes to: " + mirrorHost + "

" ); + document.write( "Fall back download goes to: " + mirrorHost + "
" ); + document.write( "
" ); } return mirrorHost; } function getMirrorHost_asf_sf_mb_weighted() { + var mirrorHost = ""; + // get total weight of the weight array (here it is 6) + var weight = eval( MIRROR_HOSTS_WEIGHT.join( "+" ) ); + // multiply the random numbe with the total weight and round it down + var randVal = Math.floor ( Math.random() * weight ); + // Assign the random position of the weighted array + var mirrorHost = MIRROR_HOSTS_WEIGHTED [ randVal ]; + + document.write( "ASF is active: " + MIRROR_ASF_ACTIVE + "
" ); + document.write( "MB is active: " + MIRROR_MB_ACTIVE + "
" ); + document.write( "SF is active: " + MIRROR_SF_ACTIVE + "
" ); + document.write( "ASF weight: " + MIRROR_HOSTS_WEIGHT[ 0 ] + "
" ); + document.write( "MB weight: " + MIRROR_HOSTS_WEIGHT[ 1 ] + "
" ); + document.write( "SF weight: " + MIRROR_HOSTS_WEIGHT[ 2 ] + "
" ); + document.write( "Total weight: " + weight + "
" ); + document.write( "Random value: " + randVal + "
" ); + document.write( "
" ); + + document.write( "Regular download goes to: " + mirrorHost + "
" ); + + // Defining fall back mirror host + + // Is Apache down? + if ( ( MIRROR_ASF_ACTIVE < 1 ) && ( mirrorHost == "Apache" ) ) + mirrorHost = "MirrorBrain"; + + // Is MirrorBrain down? + else if ( ( MIRROR_MB_ACTIVE < 1 ) && ( mirrorHost == "MirrorBrain" ) ) + mirrorHost = "SourceForge"; + + // Is SourceForge down? + else if ( ( MIRROR_SF_ACTIVE < 1 ) && ( mirrorHost == "SourceForge" ) ) + mirrorHost = "MirrorBrain"; + + // Is Apache and MirrorBrain down? + if ( ( MIRROR_ASF_ACTIVE < 1 ) && ( MIRROR_MB_ACTIVE < 1 ) ) + mirrorHost = "SourceForge"; + + // Is Apache and SourceForge down? + else if ( ( MIRROR_ASF_ACTIVE < 1 ) && ( MIRROR_SF_ACTIVE < 1 ) ) + mirrorHost = "MirrorBrain"; + + // Is MirrorBrain and SourceForge down? + else if ( ( MIRROR_MB_ACTIVE < 1 ) && ( MIRROR_SF_ACTIVE < 1 ) ) + mirrorHost = "Apache"; + + // None is working, we have a problem + if ( ( MIRROR_ASF_ACTIVE < 1 ) && ( MIRROR_MB_ACTIVE < 1 ) + && ( MIRROR_SF_ACTIVE < 1 ) ) + mirrorHost = "None, what to do?"; + + document.write( "Fall back download goes to: " + mirrorHost + "
" ); + document.write( "
" ); + + return mirrorHost; +} + +function getMirrorHost_asf_sf_mb_weighted2() { var mirrorHost = ""; var weight = MIRROR_ASF_WEIGHT + MIRROR_MB_WEIGHT + MIRROR_SF_WEIGHT; var randVal = Math.random(); document.write( "ASF is active: " + MIRROR_ASF_ACTIVE + "
" ); - document.write( "SF is active: " + MIRROR_SF_ACTIVE + "
" ); document.write( "MB is active: " + MIRROR_MB_ACTIVE + "
" ); + document.write( "SF is active: " + MIRROR_SF_ACTIVE + "
" ); document.write( "ASF weight: " + MIRROR_ASF_WEIGHT + " "); document.write( "with threshold: " + ( MIRROR_ASF_WEIGHT / weight ) + "
" ); document.write( "MB weight: " + MIRROR_MB_WEIGHT + " "); @@ -139,9 +205,10 @@ function getMirrorHost_asf_sf_mb_weighte // Are MirrorBrain mirrors working? if ( MIRROR_MB_ACTIVE > 0 ) { - // If random value is lower than SF weight divided by the total weight - // and higher than ASF weight divided by the total weight - if ( randVal < ( MIRROR_SF_WEIGHT / weight ) && ( randVal > ( MIRROR_ASF_WEIGHT / weight ) )) { + // If random value is lower than SF weight divided by the total weight + // and higher than ASF weight divided by the total weight + if ( ( randVal > ( MIRROR_ASF_WEIGHT / weight ) ) + && ( randVal < ( MIRROR_SF_WEIGHT / weight ) ) ) { mirrorHost = "MirrorBrain"; } } @@ -153,6 +220,7 @@ function getMirrorHost_asf_sf_mb_weighte mirrorHost = "SourceForge"; } } + document.write( "Regular download goes to: " + mirrorHost + "
" ); // Defining fall back mirror host @@ -161,20 +229,21 @@ function getMirrorHost_asf_sf_mb_weighte if ( MIRROR_ASF_ACTIVE > 0 ) { mirrorHost = "Apache"; - // Else are SourceForge mirrors working? - } else if ( MIRROR_SF_ACTIVE > 0 ) { - mirrorHost = "SourceForge"; - // Else are MirrorBrain mirrors working? } else if ( MIRROR_MB_ACTIVE > 0 ) { mirrorHost = "MirrorBrain"; + // Else are SourceForge mirrors working? + } else if ( MIRROR_SF_ACTIVE > 0 ) { + mirrorHost = "SourceForge"; + // None is working, we have a problem } else { mirrorHost = "None, what to do?"; } - document.write( "Fall back download goes to: " + mirrorHost + "

" ); + document.write( "Fall back download goes to: " + mirrorHost + "
" ); + document.write( "
" ); } return mirrorHost; Modified: websites/staging/ooo-site/trunk/content/download/test/globalvars_new_dl.js ============================================================================== --- websites/staging/ooo-site/trunk/content/download/test/globalvars_new_dl.js (original) +++ websites/staging/ooo-site/trunk/content/download/test/globalvars_new_dl.js Sun Apr 8 01:56:53 2012 @@ -15,14 +15,14 @@ // The supported mirror hosts, 0 means not ready to receive load // The mirror ratio in percent -var MIRROR_ASF_ACTIVE = 1; -var MIRROR_SF_ACTIVE = 1; -var MIRROR_MB_ACTIVE = 1; -var MIRROR_RATIO_1 = 75; -var MIRROR_RATIO_2 = 33; -var MIRROR_ASF_WEIGHT = 1; -var MIRROR_MB_WEIGHT = 2; -var MIRROR_SF_WEIGHT = 3; +var MIRROR_ASF_ACTIVE = 1; +var MIRROR_SF_ACTIVE = 0; +var MIRROR_MB_ACTIVE = 1; +var MIRROR_RATIO_1 = 75; +var MIRROR_RATIO_2 = 33; +var MIRROR_HOSTS = [ "Apache", "MirrorBrain", "SourceForge" ]; +var MIRROR_HOSTS_WEIGHT = [ 1, 2, 3 ]; +var MIRROR_HOSTS_WEIGHTED = [ "Apache", "MirrorBrain", "MirrorBrain", "SourceForge", "SourceForge", "SourceForge" ]; // Exchange the variables resp. its content to switch the MirrorBrain server var MIRROR_BOUNCER_URL = "http://openoffice.bouncer.osuosl.org/";