Exemple #1
0
        private void StartNewLoadTest(StartNewLoadTest message)
        {
            Console.WriteLine("a.lsdkfvnadklsfvnmaxfnvm,dfnvdnfbdfnmbdfnmvdm,fvnmasdfnvm,afnvm,asdfbm,a<dbnm,adfnbm,adfnb,madfnbm,adfbnm,adfbn");
            var testRunActor = Context.ActorOf(Props.Create(() => new TestRunActor(message)));

            testRunActor.Forward(message);
        }
        public AgentActor(StartNewLoadTest startNewLoadTest, string testId)
        {
            Console.WriteLine($"{nameof(AgentActor)} (path {Self.Path}) created.");
            this.startNewLoadTest = startNewLoadTest;
            var id = Guid.NewGuid().ToString();

            Context.ActorOf(Props.Create(() => new SenderActor(Self, startNewLoadTest.Url)).WithRouter(new BroadcastPool(startNewLoadTest.NumberOfRequestsPerAgent)), TO_SENDER_ROUTER_NAME);
            Context.ActorOf(Props.Create(() => new AggregationActor(testId, id)), AGGREGATION_ACTOR_NAME);

            Receive <RequestFinished>(m => HandleRequestFinished(m));
        }
        public TestRunActor(StartNewLoadTest message)
        {
            Console.WriteLine($"TestRun created");

            ClusterRouterPool config = new ClusterRouterPool(new BroadcastPool(message.NumberOfAgents),
                                                             new ClusterRouterPoolSettings(message.NumberOfAgents, message.NumberOfAgents, true, Constants.Roles.AGENT));
            var local  = new BroadcastPool(message.NumberOfAgents);
            var testId = Guid.NewGuid().ToString();

            Context.ActorOf(Props.Create(() => new AgentActor(message, testId)).WithRouter(config), TO_ACTOR_ROUTER_NAME);

            publishMediator = DistributedPubSub.Get(Context.System).Mediator;
            publishMediator.Tell(new Publish(Constants.Topics.TEST_TOPIC, new TestStarted(testId, message.Url)));
        }