You are viewing a plain text version of this content. The canonical link for it is here.
Posted to olio-commits@incubator.apache.org by ws...@apache.org on 2008/10/20 17:39:20 UTC
svn commit: r706345 [5/5] - in /incubator/olio/workload/rails: ./ trunk/
trunk/bin/ trunk/config/ trunk/config/security/ trunk/deploy/ trunk/lib/
trunk/mysql-connector-java-5.0.6/ trunk/mysql-connector-java-5.0.6/debug/
trunk/mysql-connector-java-5.0.6...
Added: incubator/olio/workload/rails/trunk/tmp/MemCacheUtility.java
URL: http://svn.apache.org/viewvc/incubator/olio/workload/rails/trunk/tmp/MemCacheUtility.java?rev=706345&view=auto
==============================================================================
--- incubator/olio/workload/rails/trunk/tmp/MemCacheUtility.java (added)
+++ incubator/olio/workload/rails/trunk/tmp/MemCacheUtility.java Mon Oct 20 10:39:16 2008
@@ -0,0 +1,326 @@
+/*
+ * MemCacheUtility.java
+ *
+ * Created on August 20, 2007, 10:23 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.sun.web20.util;
+
+import com.danga.MemCached.MemCachedClient;
+import com.danga.MemCached.SockIOPool;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
+import java.util.ArrayList;
+import com.sun.faban.common.TextTable;
+import com.sun.faban.common.NameValuePair;
+import java.util.TimerTask;
+import java.util.Timer;
+
+import java.util.logging.Logger;
+
+
+
+/**
+ *
+ * @author Kim LiChong
+ */
+public class MemCacheUtility {
+
+ private static MemCachedClient cache = null;
+ private String[] serverList = null;
+ static Logger logger = Logger.getLogger(
+ MemCacheUtility.class.getName());
+
+
+ /** This constructor creates a new instance of MemCacheUtility
+ A memcache client is created with a pool of servers.
+ *
+ * @param servers ArrayList of NameValuePair<Integer> of servers:port numbers.
+ */
+ public MemCacheUtility(ArrayList<NameValuePair<Integer>> servers) {
+ if (cache == null) {
+ // the env memcachedInstances is in the
+ // form host1:port1, host2:port2, etc.
+ // in an ArrayList
+ //String servers = locator.getString("memcachedInstances");
+
+
+ serverList = new String[servers.size()];
+
+ serverList = convertNameValueToStringArray(servers);
+
+ //logger.info("size of the array is " + serverList.length);
+ //String[] serverList = servers.split(",?[ *]");
+ SockIOPool pool = SockIOPool.getInstance("livePool");
+ pool.setServers(serverList);
+ pool.initialize();
+
+ cache = new MemCachedClient();
+ cache.setPoolName("livePool");
+ }
+ }
+
+ /** This constructor creates a new instance of MemCacheUtility
+ A memcache client is created with a pool of servers.
+ *
+ * @param servers String [] servers:port.
+ */
+
+ public MemCacheUtility(String[] servers) {
+ if (cache == null) {
+ SockIOPool pool = SockIOPool.getInstance("livePool");
+ pool.setServers(servers);
+ pool.initialize();
+
+ cache = new MemCachedClient();
+ cache.setPoolName("livePool");
+ }
+ }
+
+ /*
+ * This method is a convenience method to convert ArrayList<NameValuePair<Integer> to
+ * a String array of server:port server2:port.
+ * @param servers ArrayList<NameValuePair<Integer>>
+ * @return String []
+ */
+
+ public static String[] convertNameValueToStringArray (ArrayList<NameValuePair<Integer>> servers) {
+ String [] serverArr = new String[servers.size()];
+
+ Iterator serverIter = servers.iterator();
+ int index = 0;
+
+ while (serverIter.hasNext()) {
+ NameValuePair<Integer> serverEntry = (NameValuePair) serverIter.next();
+ serverArr[index] = serverEntry.name + ":" + serverEntry.value;
+ //logger.info(serverEntry.name + ":" + serverEntry.value);
+ //logger.info("server list in string array " + serverArr[index]);
+ index=+1;
+ }
+ return serverArr;
+
+
+ }
+
+ /** Retrieves memcache stats for each instance of MemCacheUtility.
+ * A TextTable will be produced for each server used to create an
+ * instance of MemCacheUtility. Used to persist stats file for each server.
+ * Returning Map whose key is the servername, the value is a TextTable of statistics
+ * @return Map
+ */
+
+ public Map getStats() {
+
+
+ Map memcacheStats = cache.stats();
+ //cache.stats() will return a Map whose key is the name of the memcache server
+ //and whose value is a Map with the memcache statistics
+
+
+ //logger.info("Map size returning is " + memcacheStats.size());
+ Set serverKeys = memcacheStats.keySet(); // The set of keys in the map
+
+ //produce a TextTable for each server listed
+ Map <String ,TextTable> returnMap = new HashMap<String, TextTable>();
+
+ TextTable outputTextTable = null;
+
+ Iterator keyIter = serverKeys.iterator();
+ Iterator statsMapIter = null;
+ Set statsMapKeys = null;
+
+ //set counter to allow to set number of columns to output
+ int counter = 0;
+
+ while (keyIter.hasNext()) {
+ String key = (String)keyIter.next(); // Get the next key.
+ Map statsMap = (Map)memcacheStats.get(key); // Get the value for that key.
+ //is this case, it is a Map with the statistics
+ //get size so we know how big to make TextTable
+ outputTextTable = new TextTable(statsMap.size(), 2);
+ //set Header
+
+ outputTextTable.setHeader(0, "Parameter");
+ outputTextTable.setHeader(1, "Value");
+ //outputTextTable.setHeader(2, "for " + key);
+ //get this value's iterator
+ statsMapKeys = statsMap.keySet();
+ statsMapIter = statsMapKeys.iterator();
+ counter=0; //reset counter
+ while (statsMapIter.hasNext()) {
+ String statsKey = (String)statsMapIter.next(); // Get the next key.
+ String statsValue = (String)statsMap.get(statsKey); // Get the value for that key.
+ outputTextTable.setField(counter,0,(String)statsKey);
+ outputTextTable.setField(counter,1,(String)statsValue);
+ //logger.info(" (" + statsKey + "," + statsValue + ")");
+ counter=counter+1;
+ }
+ //add each TextTable for each server listed to return Map.
+ returnMap.put(key, outputTextTable);
+
+ }
+ return returnMap;
+ }
+
+ /* This method is used for dynamic memcache stats gathering.
+ * The TextTable will contain all memcache server instances in columns
+ * and the server parameters in rows
+ * @return TextTable
+ *@see com.sun.faban.common.TextTable
+ */
+
+ public TextTable getTemporaryStats() {
+
+ Map memcacheStats = cache.stats();
+ //cache.stats() will return a Map whose key is the name of the memcache server
+ //and whose value is a Map with the memcache statistics
+ TextTable outputTextTable = null;
+ Set serverKeys = memcacheStats.keySet(); // The set of keys in the map
+
+ Iterator keyIter = serverKeys.iterator();
+ Iterator statsMapIter = null;
+ Set statsMapKeys = null;
+
+
+ //need to determine the number of parameters in map, i.e. the number of rows in texttable
+ // number of columns = size of serverKeys
+ //the number of rows = size of map for a serverKey
+ int numberOfRows = ((Map)memcacheStats.get(keyIter.next())).size();
+ outputTextTable = new TextTable(numberOfRows, serverKeys.size()+1);
+
+ //set counter to allow to set number of columns to output
+ int counter = 0;
+ int columnIndex = 0;
+
+ //reset the iterator
+ keyIter = serverKeys.iterator();
+
+ while (keyIter.hasNext()) {
+ String key = (String)keyIter.next(); // Get the next key.
+ Map statsMap = (Map)memcacheStats.get(key); // Get the value for that key.
+ //is this case, it is a Map with the statistics
+ //get size so we know how big to make TextTable
+ // the number of rows is the number of stats
+ // the number of columns is how many server instances there are
+ //set Header
+
+ outputTextTable.setHeader(0, "Parameter");
+ outputTextTable.setHeader(columnIndex+1, key);
+
+ //get this value's iterator
+ statsMapKeys = statsMap.keySet();
+ statsMapIter = statsMapKeys.iterator();
+ counter=0; //reset counter
+ while (statsMapIter.hasNext()) {
+ String statsKey = (String)statsMapIter.next();
+ String statsValue = (String)statsMap.get(statsKey);
+ outputTextTable.setField(counter,0,(String)statsKey);
+ outputTextTable.setField(counter,columnIndex+1,(String)statsValue);
+ counter=counter+1;
+ }
+ columnIndex=columnIndex+1;
+ }
+ return outputTextTable;
+
+
+
+ }
+
+ /*
+ This main method is used to gather dynamic statistics on memcache server instances.
+ * It expects at least 4 arguments:
+ *
+ * host:server host:server (additional server instances can be designated as host1:port1 host1:port2 OR host2:port etc.
+ * -s start time: the ramp up time, in seconds. (status collection does not take place during the ramp up)
+ * -e end time: the steady state, in seconds. (time to do the statistics data collection)
+ * -i interval time: the snapshot period to collect the stats, in seconds.
+ *
+ * Usage: java com.sun.web20.MemCacheUtility server:port [server2:port server3:port] -s startTime -e endTime -i interval
+ * eg. java com.sun.web20.util.MemCacheUtility server1:12100 server2:12100 -s 300 -e 600 -i 3
+ * This will sleep for 300 seconds during ramp up, collect for 600 seconds with an interval of 3 seconds between
+ * each snapshot.
+ * @param args String []
+ *
+ */
+ public static void main (String[] args) throws InterruptedException {
+
+ if (args==null || args.length < 4) {//minimum amount of args - one server, -s, -e, -i
+ System.out.println("Usage: java com.sun.web20.MemCacheUtility server:port [server2:port server3:port] -s startTime -e endTime -i interval");
+ System.out.println(" where startTime = ramp up time in seconds. Statistics collection will NOT occur during ramp up time and will sleep for startTime period");
+ System.out.println(" endTime = steady State time in seconds. Statistics collection will only occur during the steady state period");
+ System.out.println(" interval = time between statistics collection snapshots, in seconds.");
+ }
+
+
+ int startTime = 0;
+ int endTime = 0;
+ int intervalTime = 0;
+ int numberOfServers = 0;
+ for (int i=0;i<args.length-1;i++) {
+ if(args[i].contains(":")){
+ //we have to know how many servers have been passed to arg line
+ //we will only know this after processing all of the command line args
+ //set a counter to see how many servers we have
+ numberOfServers = numberOfServers +1;
+ }
+ if(args[i].contentEquals("-s"))
+ startTime = Integer.parseInt(args[i+1])* 1000;
+ if(args[i].contentEquals("-e"))
+ endTime = Integer.parseInt(args[i+1]) * 1000;
+ if(args[i].contentEquals("-i"))
+ intervalTime = Integer.parseInt(args[i+1])* 1000;
+ }
+
+ //finished processing all of the args. populate serverList
+ String memCacheServers[] = new String [numberOfServers];
+ for (int i=0;i<numberOfServers;i++) {
+ memCacheServers[i] = args[i];
+ }
+
+ logger.info("Starting memcache stats");
+
+ //collect only during steady state
+ MemCacheUtility memCacheUtil = new MemCacheUtility(memCacheServers);
+
+ try {
+ Timer timer = new Timer();
+ MemCacheTask task = new MemCacheTask(memCacheUtil);
+ timer.scheduleAtFixedRate(task, startTime, intervalTime);
+ //only print stats for steady state period
+ Thread.sleep(endTime);
+ //wake up and stop printing stats
+ timer.cancel();
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ return;
+ }
+ }
+
+ /* class for TimerTask */
+
+ private static class MemCacheTask extends TimerTask {
+
+ private MemCacheUtility memCacheUtility;
+
+ public MemCacheTask(MemCacheUtility memCacheUtil) {
+ memCacheUtility = memCacheUtil;
+
+ }
+
+ public void run() {
+
+ System.out.println(memCacheUtility.getTemporaryStats());
+
+ }
+
+ }
+
+
+
+
+}
Added: incubator/olio/workload/rails/trunk/tmp/Web20Benchmark.java
URL: http://svn.apache.org/viewvc/incubator/olio/workload/rails/trunk/tmp/Web20Benchmark.java?rev=706345&view=auto
==============================================================================
--- incubator/olio/workload/rails/trunk/tmp/Web20Benchmark.java (added)
+++ incubator/olio/workload/rails/trunk/tmp/Web20Benchmark.java Mon Oct 20 10:39:16 2008
@@ -0,0 +1,310 @@
+
+/* The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.sun.com/cddl/cddl.html or
+ * install_dir/legal/LICENSE
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at install_dir/legal/LICENSE.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * $Id: Web20Benchmark.java,v 1.8 2007/07/25 17:56:55 akara Exp $
+ *
+ * Copyright 2005 Sun Microsystems Inc. All Rights Reserved
+ */
+package com.sun.web20.harness;
+
+import com.sun.faban.driver.core.DriverContext;
+import static com.sun.faban.harness.RunContext.*;
+import com.sun.faban.harness.RunContext;
+
+import com.sun.faban.harness.DefaultFabanBenchmark;
+import com.sun.faban.common.Command;
+import com.sun.faban.common.CommandHandle;
+
+import java.io.File;
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import com.sun.faban.harness.RemoteCallable;
+import java.util.StringTokenizer;
+import java.util.logging.Logger;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import com.sun.faban.common.NameValuePair;
+import com.sun.web20.util.MemCacheUtility;
+import com.sun.faban.common.TextTable;
+import java.io.FileWriter;
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ * Harness hook for the sample web benchmark. This class is not needed
+ * for benchmarks implemented using the Faban Driver Framework if the
+ * default behavior is sufficient. We just show the hooks you can
+ * customize in this class. If the default behavior is desired, you can
+ * leave out the benchmark-class element in benchmark.xml.
+ *
+ * @author Akara Sucharitakul
+ */
+public class Web20Benchmark extends DefaultFabanBenchmark {
+
+ static Logger logger = Logger.getLogger(
+ Web20Benchmark.class.getName());
+ int totalRunningTimeInSecs = 0;
+ private LinkedHashSet<String> hostsSet;
+ private ArrayList<NameValuePair<Integer>> hostsPorts;
+
+
+ /**
+ * Allows benchmark to validate the configuration file. Note that no
+ * execution facility is available during validation.
+ *
+ * @throws Exception if any error occurred.
+ * @see com.sun.faban.harness.RunContext#exec(com.sun.faban.common.Command)
+ */
+ public void validate() throws Exception {
+ getParamRepository().setParameter("fa:runConfig/fd:driverConfig" +
+ "[@name='UIDriver']/fd:properties/fd:property" +
+ "[@name='resourcePath']",
+ getBenchmarkDir() + "resources" + File.separator);
+ super.validate();
+ }
+
+ /**
+ * This method is called to configure the specific benchmark run
+ * Tasks done in this method include reading user parameters,
+ * logging them and initializing various local variables.
+ *
+ * @throws Exception If configuration was not successful
+ */
+ public void configure() throws Exception {
+ // Add additional configuration needs such as restarting/reconfiguring
+ // servers here.
+ boolean reloadDB = Boolean.parseBoolean(
+ params.getParameter("dbServer/reloadDB"));
+ boolean reloadMedia = Boolean.parseBoolean(
+ params.getParameter("primaryStorage/reloadMedia"));
+
+ //grab config files
+ String coolstackHome = params.getParameter("coolstackHome");
+
+ //cache servers get list of servers for the host
+ String otherServers = params.getParameter("otherServers/serverList");
+
+ // replacing all the newline characters and other white space
+ // characters with a blank space
+ otherServers = otherServers.replaceAll("\\s", " ");
+ params.setParameter("otherServers/fa:hostConfig/fa:host", otherServers);
+
+ // Find the patterns that have either hostname or hostname:port values
+ Pattern p1 = Pattern.compile("([a-zA-Z_0-9-]+):?(\\w*)\\s*");
+ Matcher m1 = p1.matcher(otherServers + ' '); // add a whitespace at end
+
+ hostsSet = new LinkedHashSet<String>();
+ hostsPorts = new ArrayList<NameValuePair<Integer>>();
+
+ // Fill up the hosts set with names of all the hosts
+ for (boolean found = m1.find(); found; found = m1.find()) {
+ NameValuePair<Integer> hostPort = new NameValuePair<Integer>();
+ hostPort.name = m1.group(1);
+ String port = m1.group(2);
+ if (port != null && port.length() > 1)
+ hostPort.value = new Integer(port);
+ //logger.info("adding host:" + hostPort.name);
+ //logger.info("with port number " + hostPort.value);
+ hostsSet.add(hostPort.name);
+ hostsPorts.add(hostPort);
+ }
+
+ // Now extract the unique hosts
+ StringBuffer hosts = new StringBuffer();
+ for (String host : hostsSet) {
+ hosts.append(host);
+ hosts.append(' ');
+ }
+
+ // Update the unique hosts to the host filed and save
+ params.setParameter("otherServers/fa:hostConfig/fa:host",
+ hosts.toString().trim());
+ logger.info("Hosts: " + params.getParameter(
+ "otherServers/fa:hostConfig/fa:host"));
+ params.save();
+ //instantiate clients
+ MemCacheUtility memUtility = new MemCacheUtility(hostsPorts);
+ //output calls to Stats for interval period
+ String [] serverArgs = MemCacheUtility.convertNameValueToStringArray(hostsPorts);
+ //create output file for each server in hostsPorts
+ File memcacheStatsFile = null;
+ FileWriter fwriter = null;
+
+
+ Map memcacheMap = memUtility.getStats();
+ Set memcacheMapKeySet = memcacheMap.keySet();
+ Iterator memcacheMapIter = memcacheMapKeySet.iterator();
+
+ while (memcacheMapIter.hasNext()) {
+ String serverKey = (String)memcacheMapIter.next(); // Get the next key.
+ TextTable statsTable = (TextTable)memcacheMap.get(serverKey); // Get the value for that key.
+ memcacheStatsFile = new File(RunContext.getOutDir() + "memCachestats.log." + serverKey);
+ fwriter = new FileWriter(memcacheStatsFile);
+ fwriter= (FileWriter)statsTable.format(fwriter);
+ fwriter.flush();
+ }
+
+ fwriter.close();
+
+ //dbserver information
+ String dbhost = params.getParameter("dbServer/fa:hostConfig/fa:host");
+ String webhost = params.getParameter("webServer/fa:hostConfig/fa:host");
+
+ boolean success = RunContext.getFile(webhost, coolstackHome + "/apache2/conf/httpd.conf", RunContext.getOutDir() + "httpd.conf." + webhost);
+ success = RunContext.getFile(webhost, coolstackHome + "/php5/lib/php.ini", RunContext.getOutDir() + "php.ini." + webhost);
+ //logger.info("Trying to see if the cnf file exists on the dbserver");
+ //get the mysql config file, if present
+ if (RunContext.isDirectory(dbhost,"/etc") && RunContext.isFile(dbhost, "/etc/my.cnf")){
+ success = RunContext.getFile(dbhost, "/etc/my.cnf", RunContext.getOutDir() + "my.cnf." + dbhost);
+ }
+ if (RunContext.isDirectory(dbhost,coolstackHome + "mysql_32bit") && RunContext.isFile(dbhost, coolstackHome + "mysql_32bit/my.cnf")){
+ success = RunContext.getFile(dbhost, "/opt/coolstack/mysql_32bit/my.cnf", RunContext.getOutDir() + "my.cnf" + webhost);
+ }
+ logger.info("Finished checking");
+
+ int scale = -1;
+ if (reloadDB || reloadMedia)
+ scale =Integer.parseInt(params.getParameter("dbServer/scale"));
+
+ CommandHandle dbHandle = null;
+ CommandHandle mediaHandle = null;
+ if (reloadDB) {
+ String dbHost = params.getParameter("dbServer/fa:hostConfig/fa:host");
+ String driver = params.getParameter("dbServer/dbDriver");
+ String connectURL = params.getParameter("dbServer/connectURL");
+ // Un-escape the URL.
+ connectURL = connectURL.replace("&", "&");
+ Command c = new Command("com.sun.web20.loader.LoadController " +
+ driver + ' ' + connectURL + ' ' + scale);
+ c.setSynchronous(false);
+ dbHandle = java(dbHost, c);
+ }
+
+ if (reloadMedia) {
+ String mediaHost = params.getParameter("primaryStorage/fa:hostConfig/fa:host");
+ Command c = new Command("loader.pl -d sfbay.sun.com -s " + scale);
+ c.setSynchronous(false);
+ c.setStreamHandling(Command.STDOUT, Command.TRICKLE_LOG);
+ c.setStreamHandling(Command.STDERR, Command.TRICKLE_LOG);
+ mediaHandle = exec(mediaHost, c);
+ }
+
+ if (dbHandle != null)
+ dbHandle.waitFor();
+
+ if (mediaHandle != null)
+ mediaHandle.waitFor();
+
+ super.configure();
+ }
+
+ /**
+ * override DefaultBenchmark's start method so memcache stats can be collected
+ * via the Web20benchmark harness class
+ */
+ public void start() throws Exception {
+ super.start();
+
+ //get the server list
+ String otherServers = params.getParameter("otherServers/serverList");
+ //get the run info
+
+ String rampUp = params.getParameter("fa:runConfig/fa:runControl/fa:rampUp");
+ String steadyState = params.getParameter("fa:runConfig/fa:runControl/fa:steadyState");
+ String rampDown = params.getParameter("fa:runConfig/fa:runControl/fa:rampDown");
+
+ //calculate total running time, including rampUp, steadyState, and rampDown
+ this.totalRunningTimeInSecs = Integer.parseInt(rampUp) + Integer.parseInt(steadyState) + Integer.parseInt(rampDown);
+
+ //for interval, get it from tools element
+ String toolString = params.getParameter("otherServers/fa:hostConfig/fh:tools");
+
+ StringTokenizer strToken = new StringTokenizer(toolString,";");
+ StringTokenizer intervalTk = null;
+ String tool = null;
+ String interval =null;
+
+ while (strToken.hasMoreTokens()) {
+ tool = strToken.nextToken();
+ if (tool.contains("memcache")) {
+ intervalTk = new StringTokenizer(tool);
+ interval = intervalTk.nextToken();
+ interval = intervalTk.nextToken();//need to do this twice to get interval period
+ }
+ }
+ //logger.info("launching memcache command with interval time of " + interval);
+ Command statsCommand = new Command(" com.sun.web20.util.MemCacheUtility " + otherServers + " -s "
+ + rampUp + " -e " + steadyState + " -i " + interval);
+ statsCommand.setStreamHandling(Command.STDOUT, Command.CAPTURE);
+ statsCommand.setOutputFile(Command.STDOUT, RunContext.getOutDir()+"memCachestats.allServers.log.out");
+ RunContext.java(statsCommand);
+ }
+
+ /* override DefaultBenchmark's end method to collect apache log file
+ * via the Web20Benchmark harness class
+ */
+
+ public void end () throws Exception {
+ //grab the system time on the Faban master machine
+
+ super.end();
+ String webhost = params.getParameter("webServer/fa:hostConfig/fa:host");
+ //grab config files
+ String coolstackHome = params.getParameter("coolstackHome");
+
+ GregorianCalendar calendar = getGregorianCalendar(webhost);
+ //gger.info("calendar is " + calendar.getTime());
+ //format the end date
+ SimpleDateFormat df = new SimpleDateFormat("MMM,dd,HH:mm:ss");
+ String beginDate = df.format(calendar.getTime());
+ //logger.info("Start Date: "+ beginDate);
+ calendar.add(Calendar.SECOND, (totalRunningTimeInSecs*(-1)));
+ //logger.info("Working backwards, start time must have been" +calendar.getTime());
+ String endDate = df.format(calendar.getTime());
+ //collect the log file
+ boolean success = RunContext.getFile(webhost,coolstackHome + "/apache2/logs/error_log", RunContext.getOutDir() + "apache.error_log." + webhost);
+ //parse the log file
+ Command parseCommand = new Command("truncate_errorlog.sh \"" + beginDate + "\""+ " \"" + endDate + "\" " +
+ //location
+ RunContext.getOutDir() + " " +
+ //host
+ webhost);
+ RunContext.exec(parseCommand);
+
+
+ }
+
+
+ public static GregorianCalendar getGregorianCalendar(String hostName) throws Exception {
+ return exec(hostName, new RemoteCallable<GregorianCalendar>() {
+ public GregorianCalendar call() {
+ return new GregorianCalendar();
+ }
+ });
+ }
+
+}
Added: incubator/olio/workload/rails/trunk/tmp/config.xhtml
URL: http://svn.apache.org/viewvc/incubator/olio/workload/rails/trunk/tmp/config.xhtml?rev=706345&view=auto
==============================================================================
--- incubator/olio/workload/rails/trunk/tmp/config.xhtml (added)
+++ incubator/olio/workload/rails/trunk/tmp/config.xhtml Mon Oct 20 10:39:16 2008
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- $Id: config.xhtml,v 1.6 2007/07/19 22:04:46 sp208304 Exp $ -->
+<html xmlns:chiba="http://chiba.sourceforge.net/2003/08/xforms"
+ xmlns:xforms="http://www.w3.org/2002/xforms"
+ xmlns:fa="http://faban.sunsource.net/ns/faban"
+ xmlns:fh="http://faban.sunsource.net/ns/fabanharness"
+ xmlns:fd="http://faban.sunsource.net/ns/fabandriver"
+
+ chiba:stylesheet="faban.xsl">
+ <head>
+ <xforms:model id="benchmark-model">
+ <xforms:instance id="benchmark-instance" src="{benchmark.template}"/>
+ <xforms:submission xforms:action="schedule-run.jsp" xforms:replace="all" id="submission-debug" xforms:method="post"/>
+ <xforms:bind id="bind-web20" xforms:nodeset="/web20">
+ <xforms:bind id="bind-jvmConfig" xforms:nodeset="fh:jvmConfig">
+ <xforms:bind id="bind-javaHome" xforms:nodeset="fh:javaHome"/>
+ <xforms:bind id="bind-jvmOptions" xforms:nodeset="fh:jvmOptions"/>
+ </xforms:bind>
+ <xforms:bind id="bind-runConfig" xforms:nodeset="fa:runConfig">
+ <xforms:bind id="bind-description" xforms:nodeset="fh:description"/>
+ <xforms:bind id="bind-runConfig-hostConfig" xforms:nodeset="fa:hostConfig">
+ <xforms:bind id="bind-agent-host" xforms:nodeset="fa:host"/>
+ <xforms:bind id="bind-agent-tools" xforms:nodeset="fh:tools"/>
+ </xforms:bind>
+ <xforms:bind id="bind-scale" xforms:nodeset="fa:scale" xforms:type="positiveInteger"/>
+ <xforms:bind id="bind-runControl" xforms:nodeset="fa:runControl">
+ <xforms:bind id="bind-unit" xforms:nodeset="@unit"/>
+ <xforms:bind id="bind-rampUp" xforms:nodeset="fa:rampUp" xforms:type="positiveInteger"/>
+ <xforms:bind id="bind-steadyState" xforms:nodeset="fa:steadyState" xforms:type="positiveInteger"/>
+ <xforms:bind id="bind-rampDown" xforms:nodeset="fa:rampDown" xforms:type="positiveInteger"/>
+ </xforms:bind>
+ <xforms:bind id="bind-threadStart" xforms:nodeset="fd:threadStart">
+ <xforms:bind id="bind-delay" xforms:nodeset="fd:delay" xforms:type="positiveInteger"/>
+ <xforms:bind id="bind-simultaneous" xforms:nodeset="fd:simultaneous"/>
+ <xforms:bind id="bind-parallel" xforms:nodeset="fd:parallel"/>
+ </xforms:bind>
+ <xforms:bind id="bind-webDriver" xforms:nodeset="fd:driverConfig[@name='UIDriver']">
+ <xforms:bind id="bind-driver-agents" xforms:nodeset="fd:agents" xforms:type="positiveInteger"/>
+ <xforms:bind id="bind-driver-statsInterval" xforms:nodeset="fd:stats/fd:interval" xforms:type="positiveInteger"/>
+ <xforms:bind id="bind-driver-properties" xforms:nodeset="fd:properties">
+ <xforms:bind id="bind-driver-serverType" xforms:nodeset="fd:property[@name='serverType']"/>
+ </xforms:bind>
+ </xforms:bind>
+ </xforms:bind>
+ <xforms:bind id="bind-coolstackHome" xforms:nodeset="coolstackHome"/>
+ <xforms:bind id="bind-webServer" xforms:nodeset="webServer">
+ <xforms:bind id="bind-webServer-hostConfig" xforms:nodeset="fa:hostConfig">
+ <xforms:bind id="bind-webServer-hostPorts" xforms:nodeset="fa:hostPorts"/>
+ <xforms:bind id="bind-webServer-tools" xforms:nodeset="fh:tools"/>
+ </xforms:bind>
+ <!-- addition here -->
+ <xforms:bind id="bind-webServer-homePath" xforms:nodeset="hostHomePath"/>
+ </xforms:bind>
+
+
+ <xforms:bind id="bind-dbServer" xforms:nodeset="dbServer">
+ <xforms:bind id="bind-dbServer-hostConfig" xforms:nodeset="fa:hostConfig">
+ <xforms:bind id="bind-dbServer-host" xforms:nodeset="fa:host"/>
+ <xforms:bind id="bind-dbServer-tools" xforms:nodeset="fh:tools"/>
+ </xforms:bind>
+ <xforms:bind id="bind-dbDriver" xforms:nodeset="dbDriver"/>
+ <xforms:bind id="bind-connectURL" xforms:nodeset="connectURL"/>
+ <xforms:bind id="bind-reloadDB" xforms:nodeset="reloadDB" xforms:type="boolean"/>
+ <xforms:bind id="bind-load-scale" xforms:nodeset="scale" xforms:type="positiveInteger"/>
+ <!-- addition here -->
+ <xforms:bind id="bind-db-homePath" xforms:nodeset="dbHomePath" />
+ </xforms:bind>
+ <xforms:bind id="bind-primaryStorage" xforms:nodeset="primaryStorage">
+ <xforms:bind id="bind-primaryStorage-hostConfig" xforms:nodeset="fa:hostConfig">
+ <xforms:bind id="bind-primaryStorage-host" xforms:nodeset="fa:host"/>
+ <xforms:bind id="bind-primaryStorage-tools" xforms:nodeset="fh:tools"/>
+ </xforms:bind>
+ <xforms:bind id="bind-reloadMedia" xforms:nodeset="reloadMedia" xforms:type="boolean"/>
+ </xforms:bind>
+ <xforms:bind id="bind-otherServers" xforms:nodeset="otherServers">
+ <xforms:bind id="bind-otherServers-hostConfig" xforms:nodeset="fa:hostConfig">
+ <xforms:bind id="bind-otherServers-host" xforms:nodeset="fa:host"/>
+ <xforms:bind id="bind-otherServers-tools" xforms:nodeset="fh:tools"/>
+ </xforms:bind>
+ </xforms:bind>
+ </xforms:bind>
+ </xforms:model>
+ <xforms:model id="benchmark-labels">
+ <xforms:instance id="benchmark-label-names">
+ <labels>
+ <benchmark>Sample Web Benchmark 1</benchmark>
+ <jvmConfig>Java</jvmConfig>
+ <javaHome>JAVA HOME</javaHome>
+ <jvmOptions>JVM Options</jvmOptions>
+ <runConfig>Driver</runConfig>
+ <description>Description</description>
+ <scale>Concurrent Users</scale>
+ <loadScale>Loaded for Concurrent Users</loadScale>
+ <runControl>Run Control</runControl>
+ <unit>Unit</unit>
+ <time>Time (sec)</time>
+ <cycles>Cycles</cycles>
+ <rampUp>Ramp Up</rampUp>
+ <steadyState>Steady State</steadyState>
+ <rampDown>Ramp Down</rampDown>
+ <yes>Yes</yes>
+ <no>No</no>
+ <threadStart>Email</threadStart>
+ <delay>Delay between thread starts (ms)</delay>
+ <simultaneous>Start Threads simultaneously</simultaneous>
+ <parallel>Start Agents parallely</parallel>
+ <webDriver>WebDriver</webDriver>
+ <dbServer>Database Server</dbServer>
+ <primaryStorage>Primary Storage Server</primaryStorage>
+ <servers>Servers</servers>
+ <coolstackHeader> </coolstackHeader>
+ <coolstackHome>Path for Coolstack HOME</coolstackHome>
+ <serverType>Server type</serverType>
+ <dbDriver>JDBC driver class name</dbDriver>
+ <connectURL>JDBC connection URL</connectURL>
+ <reloadDB>Reload Database</reloadDB>
+ <reloadMedia>Reload Images</reloadMedia>
+ <dbHomePath>Path for Database Home</dbHomePath>
+ <webserverHomePath>Path for Apache Home</webserverHomePath>
+ <otherServers>Cache, Storage, or Other Servers</otherServers>
+ <agents>Agents</agents>
+ <statsInterval>Stats Collection Interval</statsInterval>
+ <serverConfig>Server Information</serverConfig>
+ <connectURL>Database Connection URL</connectURL>
+ <host>Host</host>
+ <hosts>Hosts</hosts>
+ <hostPorts>Target Host:Ports</hostPorts>
+ <port>Port</port>
+ <pathConfig>URL Path Configurations</pathConfig>
+ <java>Java</java>
+ <php>PHP</php>
+ <tools>Tools</tools>
+ <ok>Ok</ok>
+ <cancel>Cancel</cancel>
+ </labels>
+ </xforms:instance>
+ </xforms:model>
+ </head>
+ <body>
+ <xforms:group id="group-tabsheet">
+ <xforms:trigger id="trigger-jvmConfig">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/jvmConfig"/>
+ <xforms:action id="action-jvmConfig">
+ <xforms:revalidate xforms:model="benchmark-model" id="revalidate-jvmConfig"/>
+ <xforms:toggle id="toggle-jvmConfig" xforms:case="case-jvmConfig"/>
+ </xforms:action>
+ </xforms:trigger>
+ <xforms:trigger id="trigger-runConfig">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/runConfig"/>
+ <xforms:action id="action-runConfig">
+ <xforms:revalidate xforms:model="benchmark-model" id="revalidate-runConfig"/>
+ <xforms:toggle id="toggle-runConfig" xforms:case="case-runConfig"/>
+ </xforms:action>
+ </xforms:trigger>
+ <xforms:trigger id="trigger-webDriver">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/webDriver"/>
+ <xforms:action id="action-webDriver">
+ <xforms:revalidate xforms:model="benchmark-model" id="revalidate-webDriver"/>
+ <xforms:toggle id="toggle-webDriver" xforms:case="case-webDriver"/>
+ </xforms:action>
+ </xforms:trigger>
+ <xforms:trigger id="trigger-servers">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/servers"/>
+ <xforms:action id="action-servers">
+ <xforms:revalidate xforms:model="benchmark-model" id="revalidate-servers"/>
+ <xforms:toggle id="toggle-servers" xforms:case="case-servers"/>
+ </xforms:action>
+ </xforms:trigger>
+ <xforms:switch id="switch">
+ <xforms:case id="case-jvmConfig" xforms:selected="true">
+ <xforms:group id="group-nogroup">
+ <xforms:input id="input-javaHome" xforms:bind="bind-javaHome">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/javaHome"/>
+ </xforms:input>
+ <xforms:input id="input-jvmOptions" xforms:bind="bind-jvmOptions">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/jvmOptions"/>
+ </xforms:input>
+ </xforms:group>
+ </xforms:case>
+ <xforms:case id="case-runConfig">
+ <xforms:group id="group-nogroup">
+ <xforms:textarea id="input-description" xforms:bind="bind-description">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/description"/>
+ <xforms:hint>Enter description of this run</xforms:hint>
+ </xforms:textarea>
+ <xforms:input id="input-agent-host" xforms:bind="bind-agent-host">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/host"/>
+ <xforms:hint>Enter machine names separated by space</xforms:hint>
+ </xforms:input>
+ <xforms:input id="input-scale" xforms:bind="bind-scale">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/scale"/>
+ <xforms:hint>Enter Transaction rate</xforms:hint>
+ <xforms:help>Enter Transaction rate (Default 1)</xforms:help>
+ <xforms:alert>Not a valid number</xforms:alert>
+ </xforms:input>
+ <xforms:input id="input-agent-tools" xforms:bind="bind-agent-tools">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/tools"/>
+ <xforms:hint>Enter tool commands to collect statistics, separated by semi-colon</xforms:hint>
+ <xforms:help>Enter tool commands to collect statistics, separated by semi-colon</xforms:help>
+ </xforms:input>
+ </xforms:group>
+ <xforms:group id="group-runControl">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/runControl"/>
+ <xforms:output xforms:bind="bind-unit"/>
+ <xforms:input id="input-rampUp" xforms:bind="bind-rampUp">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/rampUp"/>
+ </xforms:input>
+ <xforms:input id="input-steadyState" xforms:bind="bind-steadyState">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/steadyState"/>
+ </xforms:input>
+ <xforms:input id="input-rampDown" xforms:bind="bind-rampDown">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/rampDown"/>
+ </xforms:input>
+ </xforms:group>
+ </xforms:case>
+ <xforms:case id="case-webDriver">
+ <xforms:group id="group-nogroup">
+ <xforms:input id="input-driver-agents" xforms:bind="bind-driver-agents">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/agents"/>
+ <xforms:hint>The number of agents to run for this driver</xforms:hint>
+ <xforms:help>Enter the number of agents for this driver</xforms:help>
+ <xforms:alert>Not a valid number</xforms:alert>
+ </xforms:input>
+ <xforms:input id="input-driver-statsInterval" xforms:bind="bind-driver-statsInterval">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/statsInterval"/>
+ <xforms:hint>The interval, in seconds, to collect detailed statistics</xforms:hint>
+ <xforms:help>Enter the interval, in seconds, to collect detailed statistics</xforms:help>
+ <xforms:alert>Not a valid number</xforms:alert>
+ </xforms:input>
+ </xforms:group>
+ <xforms:group id="group-serverConfig">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/serverConfig"/>
+ <xforms:input id="input-webServer-hostPorts" xforms:bind="bind-webServer-hostPorts">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/hostPorts"/>
+ <xforms:hint>The server host name or IP address and port pairs in the form host:port, space separated</xforms:hint>
+ <xforms:help>Enter the server host name or IP address and port pairs in the form host:port, space separated</xforms:help>
+ </xforms:input>
+ <xforms:input id="input-webServer-path" xforms:bind="bind-webServer-homePath">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/webserverHomePath"/>
+ <xforms:hint>Enter the path to $WEBSERVER_HOME</xforms:hint>
+ <xforms:help>Enter the path to $WEBSERVER_HOME</xforms:help>
+ </xforms:input>
+ <xforms:select1 id="select1-serverType" xforms:bind="bind-driver-serverType">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/serverType"/>
+ <xforms:choices>
+ <xforms:item>
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/java"/>
+ <xforms:value>jsp</xforms:value>
+ </xforms:item>
+ <xforms:item>
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/php"/>
+ <xforms:value>php</xforms:value>
+ </xforms:item>
+ <xforms:hint>Choose the server architecture type.</xforms:hint>
+ <xforms:help>Choose the server architecture type.</xforms:help>
+ </xforms:choices>
+ </xforms:select1>
+ <xforms:input id="input-webServer-tools" xforms:bind="bind-webServer-tools">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/tools"/>
+ <xforms:hint>Enter tool commands to collect statistics, separated by semi-colon</xforms:hint>
+ <xforms:help>Enter tool commands to collect statistics, separated by semi-colon</xforms:help>
+ </xforms:input>
+ </xforms:group>
+ </xforms:case>
+ <xforms:case id="case-servers">
+ <xforms:group id="group-general">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/coolstackHeader"/>
+ <xforms:input id="input-coolstackHome" xforms:bind="bind-coolstackHome">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/coolstackHome"/>
+ <xforms:hint>Enter path to installation of Coolstack HOME </xforms:hint>
+ <xforms:help>Enter path to installation of Coolstack HOME</xforms:help>
+ </xforms:input>
+ </xforms:group>
+ <xforms:group id="group-dbServer">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/dbServer"/>
+ <xforms:input id="input-dbServer-host" xforms:bind="bind-dbServer-host">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/host"/>
+ <xforms:hint>The server host name or IP address</xforms:hint>
+ <xforms:help>Enter the server host name or IP address</xforms:help>
+ </xforms:input>
+ <xforms:input id="input-dbDriver" xforms:bind="bind-dbDriver">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/dbDriver"/>
+ <xforms:hint>The JDBC driver class name</xforms:hint>
+ <xforms:help>Enter the JDBC driver class name</xforms:help>
+ </xforms:input>
+ <xforms:input id="input-connectURL" xforms:bind="bind-connectURL">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/connectURL"/>
+ <xforms:hint>The JDBC connection URL</xforms:hint>
+ <xforms:help>Enter the JDBC connection URL</xforms:help>
+ </xforms:input>
+ <xforms:select1 id="select1-reloadDB" xforms:bind="bind-reloadDB">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/reloadDB"/>
+ <xforms:choices>
+ <xforms:item>
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/yes"/>
+ <xforms:value>true</xforms:value>
+ </xforms:item>
+ <xforms:item>
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/no"/>
+ <xforms:value>false</xforms:value>
+ </xforms:item>
+ <xforms:hint>Yes to reload the database, otherwise database not reloaded.</xforms:hint>
+ <xforms:help>Yes to reload the database, otherwise database not reloaded.</xforms:help>
+ </xforms:choices>
+ </xforms:select1>
+ <xforms:input id="input-load-scale" xforms:bind="bind-load-scale">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/loadScale"/>
+ <xforms:hint>Enter the number of concurrent users data is loaded for</xforms:hint>
+ <xforms:help>Enter the number of concurrent users data is loaded for</xforms:help>
+ </xforms:input>
+ <xforms:input id="input-dbServer-tools" xforms:bind="bind-dbServer-tools">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/tools"/>
+ <xforms:hint>Enter tool commands to collect statistics, separated by semi-colon</xforms:hint>
+ <xforms:help>Enter tool commands to collect statistics, separated by semi-colon</xforms:help>
+ </xforms:input>
+ <xforms:input id="input-db-homePath" xforms:bind="bind-db-homePath">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/dbHomePath"/>
+ <xforms:hint>Enter the path to $DATABASE_HOME</xforms:hint>
+ <xforms:help>Enter the path to $DATABASE_HOME</xforms:help>
+ </xforms:input>
+ </xforms:group>
+ <xforms:group id="group-primaryStorage">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/primaryStorage"/>
+ <xforms:input id="input-primaryStorage-host" xforms:bind="bind-primaryStorage-host">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/host"/>
+ <xforms:hint>The server host name or IP address</xforms:hint>
+ <xforms:help>Enter the server host name or IP address</xforms:help>
+ </xforms:input>
+ <xforms:select1 id="select1-reloadMedia" xforms:bind="bind-reloadMedia">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/reloadMedia"/>
+ <xforms:choices>
+ <xforms:item>
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/yes"/>
+ <xforms:value>true</xforms:value>
+ </xforms:item>
+ <xforms:item>
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/no"/>
+ <xforms:value>false</xforms:value>
+ </xforms:item>
+ <xforms:hint>Yes to reload the images, otherwise images not reloaded.</xforms:hint>
+ <xforms:help>Yes to reload the images, otherwise images not reloaded.</xforms:help>
+ </xforms:choices>
+ </xforms:select1>
+ <xforms:input id="input-primaryStorage-tools" xforms:bind="bind-primaryStorage-tools">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/tools"/>
+ <xforms:hint>Enter tool commands to collect statistics, separated by semi-colon</xforms:hint>
+ <xforms:help>Enter tool commands to collect statistics, separated by semi-colon</xforms:help>
+ </xforms:input>
+ </xforms:group>
+ <xforms:group id="group-otherServers">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/otherServers"/>
+ <xforms:input id="input-otherServers-host" xforms:bind="bind-otherServers-host">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/hosts"/>
+ <xforms:hint>The servers' host names or IP addresses, space separated</xforms:hint>
+ <xforms:help>Enter the servers' host names or IP addresses, space separated</xforms:help>
+ </xforms:input>
+ <xforms:input id="input-otherServers-tools" xforms:bind="bind-otherServers-tools">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/tools"/>
+ <xforms:hint>Enter tool commands to collect statistics, separated by semi-colon</xforms:hint>
+ <xforms:help>Enter tool commands to collect statistics, separated by semi-colon</xforms:help>
+ </xforms:input>
+ </xforms:group>
+ </xforms:case>
+ </xforms:switch>
+ </xforms:group>
+
+
+ <xforms:group id="group-buttons">
+ <xforms:trigger id="trigger-ok">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/ok"/>
+ <xforms:action id="action-ok">
+ <xforms:send id="send-debug" xforms:submission="submission-debug"/>
+ </xforms:action>
+ </xforms:trigger>
+ <xforms:trigger id="trigger-cancel">
+ <xforms:label xforms:model="benchmark-labels" xforms:ref="/labels/cancel"/>
+ <xforms:action id="action-cancel">
+ <xforms:reset id="reset-cancel" xforms:model="benchmark-model"/>
+ <xforms:toggle id="toggle-cancel" xforms:case="case-jvmConfig"/>
+ </xforms:action>
+ </xforms:trigger>
+ </xforms:group>
+ </body>
+</html>
Added: incubator/olio/workload/rails/trunk/tmp/run.xml
URL: http://svn.apache.org/viewvc/incubator/olio/workload/rails/trunk/tmp/run.xml?rev=706345&view=auto
==============================================================================
--- incubator/olio/workload/rails/trunk/tmp/run.xml (added)
+++ incubator/olio/workload/rails/trunk/tmp/run.xml Mon Oct 20 10:39:16 2008
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web20>
+ <jvmConfig xmlns="http://faban.sunsource.net/ns/fabanharness">
+ <javaHome>/usr/jdk/instances/jdk1.6.0</javaHome>
+ <jvmOptions>-Xmx1g -Xms256m -XX:+DisableExplicitGC</jvmOptions>
+ </jvmConfig>
+
+ <fa:runConfig definition="com.sun.web20.driver.UIDriver" xmlns="http://faban.sunsource.net/ns/fabandriver" xmlns:fa="http://faban.sunsource.net/ns/faban" xmlns:fh="http://faban.sunsource.net/ns/fabanharness">
+ <fh:description>Run with successful login, addPerson and addEvent transaction.</fh:description>
+
+ <fa:hostConfig>
+ <fa:host>lab2</fa:host>
+ <fh:enabled>true</fh:enabled>
+ <fh:cpus>0</fh:cpus>
+ <fh:tools>vmstat 10</fh:tools>
+ <fh:userCommands/>
+ </fa:hostConfig>
+
+ <fa:scale>2</fa:scale>
+
+ <fa:runControl>
+ <fa:rampUp>200</fa:rampUp>
+ <fa:steadyState>600</fa:steadyState>
+ <fa:rampDown>30</fa:rampDown>
+ </fa:runControl>
+
+ <outputDir>/apps/faban/output/web20.91a/</outputDir>
+
+ <audit>false</audit>
+ <threadStart>
+
+ <delay>1000</delay>
+
+ <simultaneous>false</simultaneous>
+
+ <parallel>false</parallel>
+ </threadStart>
+
+
+ <stats>
+ <maxRunTime>6</maxRunTime>
+ <interval>30</interval>
+ </stats>
+
+ <runtimeStats enabled="false">
+ <interval>5</interval>
+ </runtimeStats>
+
+
+ <driverConfig name="UIDriver">
+
+ <agents>1</agents>
+
+ <stats>
+ <interval>30</interval>
+ </stats>
+
+ <runtimeStats target="9988"/>
+ <properties>
+ <property name="serverType">php</property>
+ <property name="resourcePath">/apps/faban/benchmarks/web20/resources/</property>
+ </properties>
+
+ </driverConfig>
+ </fa:runConfig>
+
+ <coolstackHome>/opt/coolstack</coolstackHome>
+
+ <webServer>
+ <fa:hostConfig xmlns="http://faban.sunsource.net/ns/fabanharness" xmlns:fa="http://faban.sunsource.net/ns/faban">
+ <fa:host>brazilian</fa:host>
+ <enabled>true</enabled>
+ <cpus>0</cpus>
+ <tools>vmstat 10; mpstat 10; netsum -a -i 10; vmstat 10</tools>
+ <userCommands/>
+ </fa:hostConfig>
+ <port>8080</port>
+ <hostHomePath>/opt/coolstack/apache2</hostHomePath>
+ </webServer>
+ <dbServer>
+ <fa:hostConfig xmlns="http://faban.sunsource.net/ns/fabanharness" xmlns:fa="http://faban.sunsource.net/ns/faban">
+ <fa:host>taxes-ge0</fa:host>
+ <enabled>true</enabled>
+ <cpus>0</cpus>
+ <tools>vmstat 10; mpstat 10; netsum -a -i 10</tools>
+ <userCommands/>
+ </fa:hostConfig>
+ <dbDriver>com.mysql.jdbc.Driver</dbDriver>
+ <connectURL>jdbc:mysql://taxes-ge0/web20load?user=web20&password=web20&relaxAutoCommit=true&sessionVariables=FOREIGN_KEY_CHECKS=0</connectURL>
+ <reloadDB>true</reloadDB>
+ <scale>1000</scale>
+ <dbHomePath>/opt/coolstack/mysql_32bit</dbHomePath>
+ </dbServer>
+ <primaryStorage>
+ <fa:hostConfig xmlns:fa="http://faban.sunsource.net/ns/faban"
+ xmlns="http://faban.sunsource.net/ns/fabanharness">
+ <fa:host>dn15</fa:host>
+ <enabled>true</enabled>
+ <cpus>0</cpus>
+ <tools>NONE</tools>
+ <userCommands></userCommands>
+ </fa:hostConfig>
+ <reloadMedia>false</reloadMedia>
+ </primaryStorage>
+ <otherServers>
+ <fa:hostConfig xmlns="http://faban.sunsource.net/ns/fabanharness" xmlns:fa="http://faban.sunsource.net/ns/faban">
+ <fa:host></fa:host>
+ <enabled>true</enabled>
+ <cpus>0</cpus>
+ <tools>memcache 10</tools>
+ <userCommands/>
+ </fa:hostConfig>
+ <serverList>brazilian:11212 brazilian:11211</serverList>
+ </otherServers>
+</web20>
\ No newline at end of file
Added: incubator/olio/workload/rails/trunk/tmp/truncate_errorlog.sh
URL: http://svn.apache.org/viewvc/incubator/olio/workload/rails/trunk/tmp/truncate_errorlog.sh?rev=706345&view=auto
==============================================================================
--- incubator/olio/workload/rails/trunk/tmp/truncate_errorlog.sh (added)
+++ incubator/olio/workload/rails/trunk/tmp/truncate_errorlog.sh Mon Oct 20 10:39:16 2008
@@ -0,0 +1,55 @@
+
+start_date=$1
+end_date=$2
+location=$3
+host=$4
+
+oldifs="$IFS"
+IFS=","
+set $start_date
+smon=$1
+sday=$2
+stime=$3
+
+echo Start $smon $sday $stime
+
+set $end_date
+emon=$1
+eday=$2
+etime=$3
+echo End $emon $eday $etime
+IFS="$oldifs"
+
+cat ${location}/apache.error_log.${host} | nawk -v smon="$smon" -v sday="$sday" -v stime="$stime" \
+ -v emon="$emon" -v eday="$eday" -v etime="$etime" '{
+ split(stime,startArr,":")
+ split(etime,endArr,":")
+ xmon=$2; xday=$3; split($4,arr,":")
+
+ if (smon == xmon && sday < xday) {
+ if (eday > xday) print $0
+ } else if (smon == xmon && eday > xday) {
+ print $0
+ } else if (smon == xmon && sday == xday) {
+ if (startArr[1] < arr[1] && endArr[1] > arr[1]) {
+ print $0
+ } else if (startArr[1] == arr[1] && endArr[1] > arr[1]) {
+ if (startArr[2] <= arr[2]) {
+ print $0
+ }
+ } else if (startArr[1] == arr[1] && endArr[1] == arr[1]) {
+ if (startArr[2] <= arr[2] && endArr[2] >= arr[2]) {
+ print $0
+ }
+
+ } else if (startArr[1] < arr[1] && endArr[1] == arr[1]) {
+ if (endArr[2] >= arr[2]) print $0
+ }
+
+
+ }
+ if (emon ==xmon && eday == xday) {
+ if (endArr[1] > arr[1]) print $0
+ if (endArr[1] == arr[1] && endArr[2] > arr[2]) print $0
+ }
+}' > ${location}/apache.error_log.${host}.trunc