Skip to content

Commit

Permalink
Merge pull request #8 from marshallpierce/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
giltene committed Jan 26, 2015
2 parents 5b69208 + 9e81806 commit e0b8f81
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/LatencyUtils/LatencyStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public LatencyStats(final long lowestTrackableLatency,
if (pauseDetector == null) {
if (defaultPauseDetector == null) {
// There is no pause detector supplied, and no default set. Set the default to a default
// simple pause detector instance. [User feedback seems to be that this is preferrable to
// simple pause detector instance. [User feedback seems to be that this is preferable to
// throwing an exception and forcing people to set the default themselves...]
synchronized (LatencyStats.class) {
if (defaultPauseDetector == null) {
Expand Down Expand Up @@ -247,7 +247,7 @@ public synchronized void getIntervalHistogramInto(Histogram targetHistogram) {
* Add the values value counts accumulated since the last interval histogram was taken
* into {@code toHistogram}.
*
* Calling {@link #getIntervalHistogramInto}() will reset
* Calling {@link #addIntervalHistogramTo}() will reset
* the interval value counts, and start accumulating value counts for the next interval.
*
* @param toHistogram the histogram into which the interval histogram's data should be added
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/LatencyUtils/SimplePauseDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class SimplePauseDetector extends PauseDetector {
private final long pauseNotificationThreshold;
final AtomicLong consensusLatestTime = new AtomicLong();

private volatile long stallTheadMask = 0;
private volatile long stallThreadMask = 0;
private volatile long stopThreadMask = 0;

private final SimplePauseDetectorThread detectors[];
Expand Down Expand Up @@ -117,7 +117,7 @@ public void run() {
}

// This is ***TEST FUNCTIONALITY***: Spin as long as we are externally asked to stall:
while ((stallTheadMask & threadMask) != 0);
while ((stallThreadMask & threadMask) != 0);

observedLasUpdateTime = consensusLatestTime.get();
// Volatile store above makes sure new "now" is measured after observedLasUpdateTime sample
Expand Down Expand Up @@ -167,8 +167,8 @@ public void run() {
* @throws InterruptedException if internal sleep implementation throws it
*/
public void stallDetectorThreads(long threadNumberMask, long stallLength) throws InterruptedException {
long savedMask = stallTheadMask;
stallTheadMask = threadNumberMask;
long savedMask = stallThreadMask;
stallThreadMask = threadNumberMask;

long startTime = TimeServices.nanoTime();
long endTime = startTime + stallLength;
Expand All @@ -180,7 +180,7 @@ public void stallDetectorThreads(long threadNumberMask, long stallLength) throws
TimeUnit.NANOSECONDS.sleep(50000); // give things a chance to propagate.
}

stallTheadMask = savedMask;
stallThreadMask = savedMask;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/LatencyUtils/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* <li>When a pause occurs outside of the tracked operation (and outside of the tracked time window) no long
* latency value would be recorded, even though any requested operation would be stalled by the pause.</li>
* </ul>
* <p>
*
* <h3>The Solution</h3>
* The {@link org.LatencyUtils.LatencyStats} class is designed for simple, drop-in use as a latency behavior
* recording object in common in-process latency recording and tracking situations. LatencyStats includes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import org.junit.Assert;
import org.junit.Test;

import java.lang.ref.WeakReference;


/**
* JUnit test for {@link org.LatencyUtils.MovingAverageIntervalEstimatorTest}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package org.LatencyUtils;

import org.junit.*;
import java.io.*;
import java.lang.ref.WeakReference;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.junit.Assert;
import org.junit.Test;

import java.lang.ref.WeakReference;
import java.util.concurrent.TimeUnit;


Expand Down

0 comments on commit e0b8f81

Please sign in to comment.