You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2010/09/20 03:28:38 UTC
svn commit: r998756 -
/commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
Author: psteitz
Date: Mon Sep 20 01:28:38 2010
New Revision: 998756
URL: http://svn.apache.org/viewvc?rev=998756&view=rev
Log:
Javadoc fixes, made some variables final.
Modified:
commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
Modified: commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
URL: http://svn.apache.org/viewvc/commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java?rev=998756&r1=998755&r2=998756&view=diff
==============================================================================
--- commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java (original)
+++ commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java Mon Sep 20 01:28:38 2010
@@ -149,10 +149,10 @@ public abstract class ClientThread imple
for (int i = 0; i < iterations; i++) {
try {
setUp();
- // Generate next interarrival time. If that is in the
+ // Generate next inter-arrival time. If that is in the
// past, go right away and log a miss; otherwise wait.
- long elapsed = System.currentTimeMillis() - lastStart;
- long nextDelay = nextDelay();
+ final long elapsed = System.currentTimeMillis() - lastStart;
+ final long nextDelay = nextDelay();
if (elapsed > nextDelay) {
numMisses++;
} else {
@@ -219,7 +219,7 @@ public abstract class ClientThread imple
public abstract void execute() throws Exception;
/**
- * <p>Computes the next interarrival time (time to wait between requests)
+ * <p>Computes the next inter-arrival time (time to wait between requests)
* based on configured values for min/max delay, delay type, cycle type,
* ramp type and period. Currently supports constant (always returning
* <code>minDelay</code> delay time), Poisson and Gaussian distributed
@@ -308,10 +308,10 @@ public abstract class ClientThread imple
*/
protected long nextDelay() throws ConfigurationException {
double targetDelay = 0;
- double dMinDelay = (double) minDelay;
- double dMaxDelay = (double) maxDelay;
- double delayDifference = dMaxDelay - dMinDelay;
- long currentTime = System.currentTimeMillis();
+ final double dMinDelay = (double) minDelay;
+ final double dMaxDelay = (double) maxDelay;
+ final double delayDifference = dMaxDelay - dMinDelay;
+ final long currentTime = System.currentTimeMillis();
if (cycleType.equals("none")) {
if (rampType.equals("none") ||
(currentTime - startTime) > rampPeriod) { // ramped up
@@ -323,10 +323,10 @@ public abstract class ClientThread imple
} else { // Random jumps down to delay - single period
// TODO: govern size of jumps as in oscillating
// Where we last were as proportion of way down to minDelay
- double lastProp =
+ final double lastProp =
(dMaxDelay - lastMean) / delayDifference;
// Make a random jump toward 1 (1 = all the way down)
- double prop = randomData.nextUniform(lastProp, 1);
+ final double prop = randomData.nextUniform(lastProp, 1);
targetDelay = dMaxDelay - delayDifference * prop;
}
} else if (cycleType.equals("oscillating")) {