kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | b12ffa01555ed0c44d8ef8e1ef39855304f723b90f70e627e214feb858d01a6f |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2017-02-24 11:11 -06:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2017-02-24 11:20 -06:00 |
| Parents | ad0999b1ea9c |
2 files changed
modified driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java +9 −11
| @@ -589,18 +589,16 @@ | ||
| 589 | 589 | * Sets the scale to use for the resulting latency aware policy. |
| 590 | 590 | * <p/> |
| 591 | 591 | * The {@code scale} provides control on how the weight given to older latencies |
| 592 | - * decreases over time. For a given host, if a new latency \(l\) is received at | |
| 593 | - * time \(t\), and the previously calculated average is \(prev\) calculated at | |
| 594 | - * time \(t'\), then the newly calculated average \(avg\) for that host is calculated | |
| 592 | + * decreases over time. For a given host, if a new latency {@code l} is received at | |
| 593 | + * time {@code t}, and the previously calculated average is {@code prev} calculated at | |
| 594 | + * time {@code t'}, then the newly calculated average {@code avg} for that host is calculated | |
| 595 | 595 | * thusly: |
| 596 | - * \[ | |
| 597 | - * d = \frac{t - t'}{scale} \\ | |
| 598 | - * \alpha = 1 - \left(\frac{\ln(d+1)}{d}\right) \\ | |
| 599 | - * avg = \alpha * l + (1-\alpha) * prev | |
| 600 | - * \] | |
| 596 | + * <pre>{@code d = (t - t') / scale | |
| 597 | + * alpha = 1 - (ln(d+1) / d) | |
| 598 | + * avg = alpha * l + (1 - alpha * prev)}</pre> | |
| 601 | 599 | * Typically, with a {@code scale} of 100 milliseconds (the default), if a new |
| 602 | - * latency is measured and the previous measure is 10 millisecond old (so \(d=0.1\)), | |
| 603 | - * then \(\alpha\) will be around \(0.05\). In other words, the new latency will | |
| 600 | + * latency is measured and the previous measure is 10 millisecond old (so {@code d=0.1}), | |
| 601 | + * then {@code alpha} will be around {@code 0.05}. In other words, the new latency will | |
| 604 | 602 | * weight 5% of the updated average. A bigger scale will get less weight to new |
| 605 | 603 | * measurements (compared to previous ones), a smaller one will give them more weight. |
| 606 | 604 | * <p/> |
| @@ -612,7 +610,7 @@ | ||
| 612 | 610 | * @param scale the scale to use. |
| 613 | 611 | * @param unit the unit of {@code scale}. |
| 614 | 612 | * @return this builder. |
| 615 | - * @throws IllegalArgumentException if {@code scale <e; 0}. | |
| 613 | + * @throws IllegalArgumentException if {@code scale <= 0}. | |
| 616 | 614 | */ |
| 617 | 615 | public Builder withScale(long scale, TimeUnit unit) { |
| 618 | 616 | if (scale <= 0) |
modified pom.xml +1 −15
| @@ -228,23 +228,9 @@ | ||
| 228 | 228 | <configuration> |
| 229 | 229 | <verbose>false</verbose> |
| 230 | 230 | <additionalparam>${javadoc.opts}</additionalparam> |
| 231 | - <!-- I can haz math in my javadoc (see http://zverovich.net/2012/01/14/beautiful-math-in-javadoc.html) --> | |
| 232 | - <header> | |
| 233 | - <script type="text/javascript" | |
| 234 | - src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> | |
| 235 | - </header> | |
| 236 | - <!-- open external links in a separate window --> | |
| 237 | - <bottom> | |
| 238 | - <script type="text/javascript"> | |
| 239 | - for(var i in document.links) { | |
| 240 | - var link = document.links[i]; | |
| 241 | - if (link.href.indexOf('is-external=true') != -1) link.target = '_blank'; | |
| 242 | - } | |
| 243 | - </script> | |
| 244 | - </bottom> | |
| 245 | 231 | <links> |
| 246 | 232 | <link>https://docs.oracle.com/javase/8/docs/api/</link> |
| 247 | - <link>http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc/</link> | |
| 233 | + <link>http://google.github.io/guava/releases/16.0.1/api/docs/</link> | |
| 248 | 234 | <link>http://netty.io/4.0/api/</link> |
| 249 | 235 | <!-- dependencies from driver-extras --> |
| 250 | 236 | <link>http://www.joda.org/joda-time/apidocs/</link> |