[jboss-cvs] jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor ...
Takuro Okada
t2-okada at nri.co.jp
Mon Nov 27 21:49:12 EST 2006
User: tokada
Date: 06/11/27 21:49:12
Modified: java/src/expansion/org/jboss/profiler/exp/agent/interceptor
Tag: JBossProfiler_Expansion AopInterceptor.java
ServletInterceptor.java DriverWrapper.java
Log:
Revision Changes Path
No revision
No revision
1.1.2.4 +10 -4 jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor/Attic/AopInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AopInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor/Attic/AopInterceptor.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- AopInterceptor.java 22 Nov 2006 09:07:47 -0000 1.1.2.3
+++ AopInterceptor.java 28 Nov 2006 02:49:12 -0000 1.1.2.4
@@ -76,7 +76,8 @@
private String profilerServiceAddress = null;
private String collectorFactoryName = null;
private boolean async = true;
- private int collectorPoolSize = 10;
+ private int collectorPoolSize = 1;
+ private int collectorQueueSize = Integer.MAX_VALUE;
/*
* metric factory
@@ -103,9 +104,10 @@
}
if(async) {
+ // In default, the executor gives priority to queuing.
asyncExecutor = new ThreadPoolExecutor(1, collectorPoolSize,
1000L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue<Runnable>());
+ new LinkedBlockingQueue<Runnable>(collectorQueueSize));
}
initialized.set(true);
@@ -135,6 +137,10 @@
this.collectorPoolSize = collectorPoolSize;
}
+ public void setCollectorQueueSize(int collectorQueueSize) {
+ this.collectorQueueSize = collectorQueueSize;
+ }
+
/**
* @see org.jboss.aop.advice.Interceptor#getName()
*/
1.1.2.5 +17 -6 jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor/Attic/ServletInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServletInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor/Attic/ServletInterceptor.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -b -r1.1.2.4 -r1.1.2.5
--- ServletInterceptor.java 22 Nov 2006 09:07:47 -0000 1.1.2.4
+++ ServletInterceptor.java 28 Nov 2006 02:49:12 -0000 1.1.2.5
@@ -77,12 +77,12 @@
public void init(FilterConfig filterConfig) throws ServletException {
if(initialized.get()) return;
- String category = filterConfig.getInitParameter("Category");
- if(category!=null) this.category = category;
String async = filterConfig.getInitParameter("Async");
if(async!=null) this.async = Boolean.valueOf(async);
- String collectorPoolSize = filterConfig.getInitParameter("CollectorPoolSize");
- if(collectorPoolSize!=null) collectorPoolSize = "10";
+
+ String category = filterConfig.getInitParameter("Category");
+ if(category!=null) this.category = category;
+
String profilerServiceName = filterConfig.getInitParameter("ProfilerServiceName");
String profilerServiceAddress = filterConfig.getInitParameter("ProfilerServiceAddress");
String collectorFactoryName = filterConfig.getInitParameter("CollectorFactoryName");
@@ -105,9 +105,18 @@
}
if(this.async) {
- asyncExecutor = new ThreadPoolExecutor(1, Integer.valueOf(collectorPoolSize),
+ int collectorPoolSize = 1;
+ String collectorPoolSizeString = filterConfig.getInitParameter("CollectorPoolSize");
+ if(collectorPoolSizeString!=null) collectorPoolSize = Integer.valueOf(collectorPoolSizeString);
+
+ int collectorQueueSize = Integer.MAX_VALUE;
+ String collectorQueueSizeString = filterConfig.getInitParameter("CollectorQueueSize");
+ if(collectorQueueSizeString!=null) collectorQueueSize = Integer.valueOf(collectorQueueSizeString);
+
+ // In default, the executor gives priority to queuing.
+ asyncExecutor = new ThreadPoolExecutor(1, collectorPoolSize,
1000L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue<Runnable>());
+ new LinkedBlockingQueue<Runnable>(collectorQueueSize));
}
initialized.set(true);
@@ -137,7 +146,9 @@
if(operationName!=null) {
collector = factory.createCollector(category, operationName);
}
+
filterChain.doFilter(servletRequest, servletResponse);
+
if(operationName!=null) {
factory.updateCollector(collector);
if(async) {
1.1.2.6 +11 -3 jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor/Attic/DriverWrapper.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DriverWrapper.java
===================================================================
RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/interceptor/Attic/DriverWrapper.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -b -r1.1.2.5 -r1.1.2.6
--- DriverWrapper.java 22 Nov 2006 09:07:47 -0000 1.1.2.5
+++ DriverWrapper.java 28 Nov 2006 02:49:12 -0000 1.1.2.6
@@ -81,10 +81,18 @@
if(!initialized.get()) {
if(async) {
- String collectorPoolSize = info.getProperty("jboss.profiler.CollectorPoolSize", "10");
- asyncExecutor = new ThreadPoolExecutor(1, Integer.valueOf(collectorPoolSize),
+ int collectorPoolSize = 1;
+ String collectorPoolSizeString = info.getProperty("jboss.profiler.CollectorPoolSize");
+ if(collectorPoolSizeString!=null) collectorPoolSize = Integer.valueOf(collectorPoolSizeString);
+
+ int collectorQueueSize = Integer.MAX_VALUE;;
+ String collectorQueueSizeString = info.getProperty("jboss.profiler.CollectorQueueSize");
+ if(collectorQueueSizeString!=null) collectorQueueSize = Integer.valueOf(collectorQueueSizeString);
+
+ // In default, the executor gives priority to queuing.
+ asyncExecutor = new ThreadPoolExecutor(1, collectorPoolSize,
1000L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue<Runnable>());
+ new LinkedBlockingQueue<Runnable>(collectorQueueSize));
}
category = info.getProperty("jboss.profiler.Category", DEFAULT_CATEGORY);
More information about the jboss-cvs-commits
mailing list