Author: sebb
Date: Thu Mar 11 10:52:18 2010
New Revision: 921796
URL: http://svn.apache.org/viewvc?rev=921796&view=rev
Log:
Might as well be static variables
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java?rev=921796&r1=921795&r2=921796&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java
Thu Mar 11 10:52:18 2010
@@ -47,7 +47,7 @@ public class BatchSampleSender implement
private final int numSamplesThreshold =
JMeterUtils.getPropDefault("num_sample_threshold",
DEFAULT_NUM_SAMPLE_THRESHOLD); // $NON-NLS-1$
- private final long timeThreshold =
+ private static final long TIME_THRESHOLD_MS =
JMeterUtils.getPropDefault("time_threshold", DEFAULT_TIME_THRESHOLD);
// $NON-NLS-1$
private long batchSendTime = -1;
@@ -70,7 +70,7 @@ public class BatchSampleSender implement
this.listener = listener;
log.info("Using batching for this run."
+ " Thresholds: num=" + numSamplesThreshold
- + ", time=" + timeThreshold);
+ + ", time=" + TIME_THRESHOLD_MS);
}
/**
@@ -134,13 +134,13 @@ public class BatchSampleSender implement
}
}
- if (timeThreshold != -1) {
+ if (TIME_THRESHOLD_MS != -1) {
SampleResult sr = e.getResult();
long timestamp = sr.getTimeStamp();
// Checking for and creating initial timestamp to cheak against
if (batchSendTime == -1) {
- this.batchSendTime = timestamp + timeThreshold;
+ this.batchSendTime = timestamp + TIME_THRESHOLD_MS;
}
if (batchSendTime < timestamp) {
@@ -150,7 +150,7 @@ public class BatchSampleSender implement
listener.processBatch(sampleStore);
sampleStore.clear();
}
- this.batchSendTime = timestamp + timeThreshold;
+ this.batchSendTime = timestamp + TIME_THRESHOLD_MS;
} catch (RemoteException err) {
log.error("sampleOccurred", err);
}
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java?rev=921796&r1=921795&r2=921796&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java
Thu Mar 11 10:52:18 2010
@@ -53,7 +53,7 @@ public class StatisticalSampleSender imp
private int sampleCount;
- private final long timeThreshold =
JMeterUtils.getPropDefault("time_threshold",
+ private static final long TIME_THRESHOLD_MS =
JMeterUtils.getPropDefault("time_threshold",
DEFAULT_TIME_THRESHOLD);
private long batchSendTime = -1;
@@ -76,7 +76,7 @@ public class StatisticalSampleSender imp
StatisticalSampleSender(RemoteSampleListener listener) {
this.listener = listener;
log.info("Using batching for this run." + " Thresholds: num="
- + numSamplesThreshold + ", time=" + timeThreshold);
+ + numSamplesThreshold + ", time=" + TIME_THRESHOLD_MS);
}
/**
@@ -148,11 +148,11 @@ public class StatisticalSampleSender imp
}
}
- if (timeThreshold != -1) {
+ if (TIME_THRESHOLD_MS != -1) {
long now = System.currentTimeMillis();
// Checking for and creating initial timestamp to cheak against
if (batchSendTime == -1) {
- this.batchSendTime = now + timeThreshold;
+ this.batchSendTime = now + TIME_THRESHOLD_MS;
}
if (batchSendTime < now) {
@@ -161,7 +161,7 @@ public class StatisticalSampleSender imp
log.debug("Firing time");
}
sendBatch();
- this.batchSendTime = now + timeThreshold;
+ this.batchSendTime = now + TIME_THRESHOLD_MS;
} catch (RemoteException err) {
log.warn("sampleOccurred", err);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]