I hereby claim:
- I am rayroestenburg on github.
- I am rayroestenburg (https://keybase.io/rayroestenburg) on keybase.
- I have a public key ASC-H2rpzN2skIGjRqBtqhx88CkGs0B4bxfYr1V9hcWNmAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| package akka.persistence | |
| import scala.language.postfixOps | |
| import com.typesafe.config._ | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.persistence._ |
| package akka.persistence | |
| import com.typesafe.config._ | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.persistence._ | |
| import akka.testkit._ |
| package akka.persistence | |
| import com.typesafe.config._ | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.persistence._ | |
| import akka.testkit._ |
| package akka.persistence | |
| import com.typesafe.config._ | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.persistence._ | |
| import akka.testkit._ |
| import scala.concurrent._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.util._ | |
| import java.util.concurrent.atomic.AtomicInteger | |
| def firstSucceededOf[T](futures: TraversableOnce[Future[T]])(implicit executor: ExecutionContext): Future[T] = { | |
| val p = Promise[T]() | |
| val size = futures.size | |
| val failureCount = new AtomicInteger(0) |
| /** | |
| * Venomous spiders kill slow Actors... | |
| */ | |
| trait Venom extends WebNode[Poisoned, KillSlowActors] { | |
| var time = 0L | |
| var timeBefore: Long = 0 | |
| def now = System.currentTimeMillis() | |
| override def sendSpiders(ref: ActorRef, data: Poisoned, msg: (KillSlowActors, Spider), collected: Set[ActorRef]) { |
| Testing started at 11:21 PM ... | |
| The spider: | |
| Some text to play with | |
| Some text to play with | |
| Some text to play with | |
| DiagnosticData((1,20000),1346275304836441000,WebNodeRef(Actor[akka://spider/user/printer],List(Actor[akka://spider/user/t-3], Actor[akka://spider/user/t-2], Actor[akka://spider/user/t-1]),List())) | |
| DiagnosticData((1,86000),1346275304840491000,WebNodeRef(Actor[akka://spider/user/t-1],List(Actor[akka://spider/user/transformer-with-router]),List(Actor[akka://spider/user/printer]))) | |
| DiagnosticData((1,74000),1346275304840510000,WebNodeRef(Actor[akka://spider/user/t-2],List(Actor[akka://spider/user/transformer-with-router]),List(Actor[akka://spider/user/printer]))) | |
| DiagnosticData((1,74000),1346275304840513000,WebNodeRef(Actor[akka://spider/user/t-3],List(Actor[akka://spider/user/transformer-with-router]),List(Actor[akka://spider/user/printer]))) | |
| DiagnosticData((1,46882000),1346275304840637000,WebNodeRef(Actor[akka://spider/user/transformer-with-router],List(Actor[akka://spider/user/first-transformer]),Lis |
| case class SomeMessage(id:Long, text:String) extends HasId | |
| class Transformer(next: ActorRef) extends Actor with Node{ | |
| def receive = { | |
| case m:SomeMessage => | |
| send (next, m.copy(text = (m.text.head.toUpper +: m.text.tail).toString)) | |
| } | |
| } | |
| class Printer extends Actor { |
| class SpiderTest extends TestKit(ActorSystem("spider")) with WordSpec with MustMatchers with BeforeAndAfterAll { | |
| implicit val timeout = Timeout(10 seconds) | |
| "The spider " must { | |
| "collect data about specific events " in { | |
| val printer = system.actorOf(Props(new Printer with TimingDiagnostics with WireTap { | |
| def listener = testActor | |
| }), "printer") | |
| def createDiagnostic = new Transformer(printer) with TimingDiagnostics |