Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ticket 2547 Create cluster metrics-aware Adaptive Load Balancing Routers
- Loading branch information
Helena Edelson
committed
Oct 18, 2012
1 parent
3f52eef
commit a6bf53d
Showing
10 changed files
with
548 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsDataStreamingOffSpec.scala
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
...multi-jvm/scala/akka/cluster/routing/ClusterAdaptiveLoadBalancingRouterMultiJvmSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com> | ||
*/ | ||
|
||
package akka.cluster.routing | ||
|
||
import akka.remote.testkit.{MultiNodeSpec, MultiNodeConfig} | ||
import akka.testkit.{LongRunningTest, DefaultTimeout, ImplicitSender} | ||
import akka.actor._ | ||
import akka.cluster.{ MemberStatus, MultiNodeClusterSpec } | ||
import akka.cluster.routing.ClusterRoundRobinRoutedActorMultiJvmSpec.SomeActor | ||
|
||
|
||
object ClusterAdaptiveLoadBalancingRouterMultiJvmSpec extends MultiNodeConfig { | ||
|
||
val first = role("first") | ||
val second = role("second") | ||
val third = role("third") | ||
val fourth = role("fourth") | ||
val fifth = role("fifth") | ||
|
||
// TODO - config | ||
commonConfig(debugConfig(on = false).withFallback(MultiNodeClusterSpec.clusterConfig)) | ||
|
||
} | ||
|
||
class ClusterAdaptiveLoadBalancingRouterMultiJvmNode1 extends ClusterAdaptiveLoadBalancingRouterSpec | ||
class ClusterAdaptiveLoadBalancingRouterMultiJvmNode2 extends ClusterAdaptiveLoadBalancingRouterSpec | ||
class ClusterAdaptiveLoadBalancingRouterMultiJvmNode3 extends ClusterAdaptiveLoadBalancingRouterSpec | ||
class ClusterAdaptiveLoadBalancingRouterMultiJvmNode4 extends ClusterAdaptiveLoadBalancingRouterSpec | ||
class ClusterAdaptiveLoadBalancingRouterMultiJvmNode5 extends ClusterAdaptiveLoadBalancingRouterSpec | ||
|
||
abstract class ClusterAdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(ClusterAdaptiveLoadBalancingRouterMultiJvmSpec) | ||
with MultiNodeClusterSpec | ||
with ImplicitSender with DefaultTimeout { | ||
import ClusterAdaptiveLoadBalancingRouterMultiJvmSpec._ | ||
|
||
// TODO configure properly and leverage the other pending load balancing routers | ||
lazy val router1 = system.actorOf(Props[SomeActor].withRouter(ClusterRouterConfig(MemoryLoadBalancingRouter(), | ||
ClusterRouterSettings(totalInstances = 3, maxInstancesPerNode = 1))), "router1") | ||
lazy val router2 = system.actorOf(Props[SomeActor].withRouter(ClusterRouterConfig(MemoryLoadBalancingRouter(), | ||
ClusterRouterSettings(totalInstances = 3, maxInstancesPerNode = 1))), "router2") | ||
lazy val router3 = system.actorOf(Props[SomeActor].withRouter(ClusterRouterConfig(MemoryLoadBalancingRouter(), | ||
ClusterRouterSettings(totalInstances = 3, maxInstancesPerNode = 1))), "router3") | ||
lazy val router4 = system.actorOf(Props[SomeActor].withRouter(ClusterRouterConfig(MemoryLoadBalancingRouter(), | ||
ClusterRouterSettings(totalInstances = 3, maxInstancesPerNode = 1))), "router4") | ||
lazy val router5 = system.actorOf(Props[SomeActor].withRouter(ClusterRouterConfig(MemoryLoadBalancingRouter(), | ||
ClusterRouterSettings(totalInstances = 3, maxInstancesPerNode = 1))), "router5") | ||
|
||
"A cluster with a ClusterAdaptiveLoadBalancingRouter" must { | ||
"start cluster with 5 nodes" taggedAs LongRunningTest in { | ||
awaitClusterUp(roles: _*) | ||
enterBarrier("cluster-started") | ||
awaitCond(clusterView.members.filter(_.status == MemberStatus.Up).size == roles.size) | ||
awaitCond(clusterView.clusterMetrics.size == roles.size) | ||
enterBarrier("cluster-metrics-consumer-ready") | ||
} | ||
// TODO the rest of the necessary testing. All the work needed for consumption and extraction | ||
// of the data needed is in ClusterMetricsCollector._ | ||
} | ||
} |
Oops, something went wrong.