Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A7F8D254 for ; Tue, 26 Feb 2013 21:32:10 +0000 (UTC) Received: (qmail 28433 invoked by uid 500); 26 Feb 2013 21:32:10 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 28414 invoked by uid 500); 26 Feb 2013 21:32:10 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 28407 invoked by uid 99); 26 Feb 2013 21:32:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 21:32:10 +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; Tue, 26 Feb 2013 21:32:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 85D232388B6C; Tue, 26 Feb 2013 21:31:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1450440 - /accumulo/branches/1.5/test/system/continuous/agitator.pl Date: Tue, 26 Feb 2013 21:31:47 -0000 To: commits@accumulo.apache.org From: vines@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130226213147.85D232388B6C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vines Date: Tue Feb 26 21:31:47 2013 New Revision: 1450440 URL: http://svn.apache.org/r1450440 Log: ACCUMULO-338 - Committing Chris McCubbin's patch, with some updated usage information. Modified: accumulo/branches/1.5/test/system/continuous/agitator.pl Modified: accumulo/branches/1.5/test/system/continuous/agitator.pl URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/system/continuous/agitator.pl?rev=1450440&r1=1450439&r2=1450440&view=diff ============================================================================== --- accumulo/branches/1.5/test/system/continuous/agitator.pl (original) +++ accumulo/branches/1.5/test/system/continuous/agitator.pl Tue Feb 26 21:31:47 2013 @@ -19,15 +19,38 @@ use POSIX qw(strftime); if(scalar(@ARGV) != 4 && scalar(@ARGV) != 2){ - print "Usage : agitator.pl [ ]\n"; + print "Usage : agitator.pl [:max sleep before kill in minutes] [:max sleep before tup in minutes] [ ]\n"; exit(1); } $ACCUMULO_HOME="../../.."; $HADOOP_PREFIX=$ENV{"HADOOP_PREFIX"}; -$sleep1 = $ARGV[0]; -$sleep2 = $ARGV[1]; +@sleeprange1 = split(/:/, $ARGV[0]); +$sleep1 = $sleeprange1[0]; + +@sleeprange2 = split(/:/, $ARGV[1]); +$sleep2 = $sleeprange2[0]; + +if(scalar(@sleeprange1) > 1){ + $sleep1max = $sleeprange1[1] + 1; +}else{ + $sleep1max = $sleep1; +} + +if($sleep1 > $sleep1max){ + die("sleep1 > sleep1max $sleep1 > $sleep1max"); +} + +if(scalar(@sleeprange2) > 1){ + $sleep2max = $sleeprange2[1] + 1; +}else{ + $sleep2max = $sleep2; +} + +if($sleep2 > $sleep2max){ + die("sleep2 > sleep2max $sleep2 > $sleep2max"); +} if(scalar(@ARGV) == 4){ $minKill = $ARGV[2]; @@ -104,13 +127,15 @@ while(1){ } } - sleep($sleep2 * 60); + $nextsleep2 = int(rand($sleep2max - $sleep2)) + $sleep2; + sleep($nextsleep2 * 60); $t = strftime "%Y%m%d %H:%M:%S", localtime; print STDERR "$t Running tup\n"; system("$ACCUMULO_HOME/bin/tup.sh"); print STDERR "$t Running start-dfs\n"; system("$HADOOP_PREFIX/bin/start-dfs.sh"); - sleep($sleep1 * 60); + $nextsleep1 = int(rand($sleep1max - $sleep1)) + $sleep1; + sleep($nextsleep1 * 60); }