Author: pferraro
Date: 2009-05-18 11:49:00 -0400 (Mon, 18 May 2009)
New Revision: 2429
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ActiveSessionsLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ConnectionPoolLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ReceiveTrafficLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/RequestCountLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SendTrafficLoadServlet.java
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SystemLoadServlet.java
Log:
Use jboss-logging, instead of servlet log methods
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ActiveSessionsLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ActiveSessionsLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ActiveSessionsLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -30,6 +30,7 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.HeadMethod;
+import org.jboss.logging.Logger;
/**
* @author Paul Ferraro
@@ -39,6 +40,7 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = -946741803216943778L;
+ private static Logger log = Logger.getLogger(ActiveSessionsLoadServlet.class);
/**
* @{inheritDoc}
@@ -48,7 +50,7 @@
protected void doHead(HttpServletRequest request, HttpServletResponse response)
{
HttpSession session = request.getSession(true);
- this.log("Handling session load request from: " +
request.getRequestURL().toString() + ", using session id: " + session.getId());
+ log.info("Handling session load request from: " +
request.getRequestURL().toString() + ", using session id: " + session.getId());
}
/**
@@ -62,7 +64,7 @@
String url = this.createLocalURL(request, null);
- this.log("Sending " + count + " requests to: " + url);
+ log.info("Sending " + count + " requests to: " + url);
for (int i = 0; i < count; ++i)
{
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -31,6 +31,7 @@
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.HeadMethod;
+import org.jboss.logging.Logger;
/**
* @author Paul Ferraro
@@ -40,6 +41,7 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = -946741803216943778L;
+ private static Logger log = Logger.getLogger(BusyConnectorsLoadServlet.class);
private static final String END = "end";
@@ -63,7 +65,7 @@
int count = Integer.parseInt(this.getParameter(request, COUNT,
"50"));
- this.log("Sending " + count + " concurrent requests to: " +
url);
+ log.info("Sending " + count + " concurrent requests to: " +
url);
for (int i = 0; i < count; ++i)
{
@@ -76,7 +78,7 @@
{
long end = Long.parseLong(parameter);
- this.log("Handling busy connector request from: " +
request.getRequestURL().toString());
+ log.info("Handling busy connector request from: " +
request.getRequestURL().toString());
if (end < System.currentTimeMillis())
{
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ConnectionPoolLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ConnectionPoolLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ConnectionPoolLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -33,6 +33,8 @@
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
+import org.jboss.logging.Logger;
+
/**
* @author Paul Ferraro
*
@@ -44,6 +46,7 @@
private static final String DATASOURCE = "datasource";
private static final String USER = "user";
private static final String PASSWORD = "password";
+ private static Logger log = Logger.getLogger(ConnectionPoolLoadServlet.class);
/**
* @{inheritDoc}
@@ -64,7 +67,7 @@
String user = this.getParameter(request, USER, null);
String password = this.getParameter(request, PASSWORD, null);
- this.log("Acquiring " + count + " database connections to: "
+ name);
+ log.info("Acquiring " + count + " database connections to: "
+ name);
List<Connection> connections = new ArrayList<Connection>(count);
@@ -83,7 +86,7 @@
}
finally
{
- this.log("Closing " + count + " database connections to:
" + name);
+ log.info("Closing " + count + " database connections to:
" + name);
for (Connection connection: connections)
{
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -30,6 +30,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.jboss.logging.Logger;
+
/**
* @author Paul Ferraro
*
@@ -38,6 +40,7 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = -8183119455180366670L;
+ private static Logger log = Logger.getLogger(HeapMemoryLoadServlet.class);
private static final int MB = 1024 * 1024;
@@ -61,9 +64,9 @@
// Reserve half the available free memory
long reserve = free / 2;
- this.log((total / MB) + "MB total memory");
- this.log((free / MB) + "MB free memory");
- this.log("Reserving " + (reserve / MB) + "MB of memory");
+ log.info((total / MB) + "MB total memory");
+ log.info((free / MB) + "MB free memory");
+ log.info("Reserving " + (reserve / MB) + "MB of memory");
List<Object> list = new ArrayList<Object>(2);
@@ -84,7 +87,7 @@
Thread.currentThread().interrupt();
}
- this.log("Freeing " + (reserve / MB) + "MB of memory");
+ log.info("Freeing " + (reserve / MB) + "MB of memory");
list.clear();
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ReceiveTrafficLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ReceiveTrafficLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/ReceiveTrafficLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -30,6 +30,7 @@
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
+import org.jboss.logging.Logger;
/**
* @author Paul Ferraro
@@ -40,6 +41,7 @@
/** The serialVersionUID */
private static final long serialVersionUID = 2344830128026153418L;
private static final String SIZE = "size";
+ private static Logger log = Logger.getLogger(ReceiveTrafficLoadServlet.class);
/**
* @{inheritDoc}
@@ -61,7 +63,7 @@
{
long start = System.currentTimeMillis();
- this.log("Sending " + (size / 1024) + "KB packet to: " +
url);
+ log.info("Sending " + (size / 1024) + "KB packet to: " +
url);
PutMethod method = new PutMethod(url);
method.setRequestEntity(entity);
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/RequestCountLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/RequestCountLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/RequestCountLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -27,6 +27,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.jboss.logging.Logger;
+
/**
* @author Paul Ferraro
*
@@ -35,6 +37,7 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = -5001091954463802789L;
+ private static Logger log = Logger.getLogger(RequestCountLoadServlet.class);
/**
* @{inheritDoc}
@@ -49,7 +52,7 @@
{
String url = this.createLocalURL(request, Collections.singletonMap(COUNT,
String.valueOf(count - 1)));
- this.log("Sending request count redirect to: " + url);
+ log.info("Sending request count redirect to: " + url);
response.sendRedirect(url);
}
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SendTrafficLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SendTrafficLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SendTrafficLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -31,6 +31,7 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.PostMethod;
+import org.jboss.logging.Logger;
/**
* @author Paul Ferraro
@@ -41,6 +42,7 @@
/** The serialVersionUID */
private static final long serialVersionUID = -8586013739155819909L;
private static final String SIZE = "size";
+ private static Logger log = Logger.getLogger(SendTrafficLoadServlet.class);
/**
* @{inheritDoc}
@@ -51,7 +53,7 @@
{
int size = Integer.parseInt(request.getParameter(SIZE)) * 1024;
- this.log("Writing " + (size / 1024) + "KB blob to response for:
" + request.getRequestURL().toString());
+ log.info("Writing " + (size / 1024) + "KB blob to response for:
" + request.getRequestURL().toString());
response.getOutputStream().write(new byte[size]);
response.flushBuffer();
@@ -74,7 +76,7 @@
for (int i = 0; i < duration; ++i)
{
- this.log("Sending send traffic load request to: " + url);
+ log.info("Sending send traffic load request to: " + url);
long start = System.currentTimeMillis();
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SystemLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SystemLoadServlet.java 2009-05-18
15:13:48 UTC (rev 2428)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/SystemLoadServlet.java 2009-05-18
15:49:00 UTC (rev 2429)
@@ -26,6 +26,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.jboss.logging.Logger;
+
/**
* @author Paul Ferraro
*
@@ -34,6 +36,7 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = 5665079393261425098L;
+ private static Logger log = Logger.getLogger(SystemLoadServlet.class);
/**
* @{inheritDoc}
@@ -46,7 +49,7 @@
int duration = Integer.parseInt(this.getParameter(request, DURATION,
"15")) * 1000;
- this.log("Begin handling system load request");
+ log.info("Begin handling system load request");
// Naughty loop
while (System.currentTimeMillis() - start < duration)
@@ -64,7 +67,7 @@
}
}
- this.log("End handling system load request");
+ log.info("End handling system load request");
this.writeLocalName(request, response);
}