Skip to content

Commit

Permalink
preparing release documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-bukhtoyarov committed Sep 8, 2016
1 parent 5b27355 commit 8aa006e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* <li>Writing is lock-free. Writers do not block writers and readers.</li>
* <li>Sum reading always happen inside synchronized block, so readers block each other, but readers never block writers.</li>
* </ul>
* </p>
*
* <p>
* Usage recommendations:
Expand All @@ -39,7 +38,6 @@
* Usage of this implementation for case of multiple readers will be a bad idea because of readers will steal data from each other.
* </li>
* </ul>
* </p>
*
* @see SmoothlyDecayingRollingCounter
* @see MetricsCounter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* <li>Writing is lock-free.</li>
* <li>Sum reading is lock-free.</li>
* </ul>
* </p>
*
* <p>
* Usage recommendations:
Expand All @@ -41,7 +40,6 @@
* <li>When you want to limit time which each increment takes affect to counter sum in order to avoid reporting of obsolete measurements.</li>
* <li>Only if you accept the fact that several increments can be never observed by reader(because rotation to zero can happen before reader seen the written values).</li>
* </ul>
* </p>
*
* @see SmoothlyDecayingRollingCounter
* @see MetricsCounter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@
* <li>Writing is lock-free.
* <li>Sum reading is lock-free.
* </ul>
* </p>
*
* <p>
* Usage recommendations:
* <ul>
* <li>Only when you need in "rolling time window" semantic.</li>
* </ul>
* </p>
*
* <p>
* Performance considerations:
Expand All @@ -59,7 +57,6 @@
* <li>The huge count of chunk leads to the slower calculation of their sum. So precision of sum conflicts with latency of sum. You need to choose meaningful values.
* For example 10 chunks will guarantee at least 90% accuracy and ten million reads per second.</li>
* </ul>
* </p>
*
* <p> Example of usage:
* <pre><code>
Expand All @@ -69,7 +66,6 @@
* counter.add(42);
* </code>
* </pre>
* </p>
*/
public class SmoothlyDecayingRollingCounter implements WindowCounter {

Expand Down Expand Up @@ -97,7 +93,6 @@ public class SmoothlyDecayingRollingCounter implements WindowCounter {
* counter.add(42);
* </code>
* </pre>
* </p>
*
* @param rollingWindow the rolling time window duration
* @param numberChunks The count of chunk to split counter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,11 @@ public void testToString() {
System.out.println(new ResetPeriodicallyCounter(Duration.ofMillis(1000)).toString());
}

@Test(timeout = 32000)
public void testThatConcurrentThreadsNotHung() throws InterruptedException {
WindowCounter counter = new ResetPeriodicallyCounter(Duration.ofMillis(50));
CounterTestUtil.runInParallel(counter, Duration.ofSeconds(30));
}


}

0 comments on commit 8aa006e

Please sign in to comment.