This commit is contained in:
parent
caabfdecfc
commit
5e6662c97c
2 changed files with 13 additions and 5 deletions
|
|
@ -241,7 +241,7 @@ class MetricsBasedResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultT
|
|||
msgs1.foreach(_.second.open()) //process two messages
|
||||
|
||||
// make sure some time passes inbetween
|
||||
Thread.sleep(100)
|
||||
Thread.sleep(300)
|
||||
|
||||
// wait for routees to update their mail boxes
|
||||
msgs2.foreach(l ⇒ Await.ready(l.first, timeout.duration))
|
||||
|
|
@ -273,7 +273,7 @@ class MetricsBasedResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultT
|
|||
msgs1.foreach(_.second.open()) //process two messages
|
||||
|
||||
// make sure some time passes inbetween
|
||||
Thread.sleep(100)
|
||||
Thread.sleep(300)
|
||||
|
||||
// wait for routees to update their mail boxes
|
||||
msgs2.foreach(l ⇒ Await.ready(l.first, timeout.duration))
|
||||
|
|
|
|||
|
|
@ -7,14 +7,13 @@ import java.time.LocalDateTime
|
|||
|
||||
import scala.collection.immutable
|
||||
import java.util.concurrent.ThreadLocalRandom
|
||||
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import com.typesafe.config.Config
|
||||
|
||||
import akka.actor._
|
||||
import akka.util.JavaDurationConverters._
|
||||
|
||||
import OptimalSizeExploringResizer._
|
||||
import akka.annotation.InternalApi
|
||||
|
||||
trait OptimalSizeExploringResizer extends Resizer {
|
||||
/**
|
||||
|
|
@ -126,17 +125,26 @@ case class DefaultOptimalSizeExploringResizer(
|
|||
explorationProbability: Double = 0.4,
|
||||
weightOfLatestMetric: Double = 0.5) extends OptimalSizeExploringResizer {
|
||||
/**
|
||||
* INTERNAL API
|
||||
*
|
||||
* Leave package accessible for testing purpose
|
||||
*/
|
||||
@InternalApi
|
||||
private[routing] var performanceLog: PerformanceLog = Map.empty
|
||||
/**
|
||||
* INTERNAL API
|
||||
*
|
||||
* Leave package accessible for testing purpose
|
||||
*/
|
||||
@InternalApi
|
||||
private[routing] var record: ResizeRecord = ResizeRecord()
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
*
|
||||
* Leave package accessible for testing purpose
|
||||
*/
|
||||
@InternalApi
|
||||
private[routing] var stopExploring = false
|
||||
|
||||
private def random = ThreadLocalRandom.current()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue