Esempio n. 1
0
        public async Task <UnitType> Execute(IOrchestrationContext context)
        {
            await context.PerformOrchestration(new Initialization()
            {
                NumberGenerators         = NumberGenerators,
                NumberGeneratorProcesses = NumberGeneratorProcesses,
                Workload = Workload
            });

            for (uint i = 0; i < NumberGenerators; i++)
            {
                // schedule events to stop load generation after the test duration
                context.ScheduleLocalUpdate(Duration, new StopGenerator()
                {
                    GeneratorNumber = i
                });
            }

            var DelayBetweenRequests = TimeSpan.FromSeconds(NumberGenerators / Rate);

            context.Logger.LogInformation($"Starting workload.");

            for (uint i = 0; i < NumberGenerators; i++)
            {
                var stagger = TimeSpan.FromSeconds(i / Rate);
                context.ScheduleLocalUpdate(stagger, new GeneratorIteration()
                {
                    GeneratorNumber      = i,
                    Iteration            = 0,
                    DelayBetweenRequests = DelayBetweenRequests,
                    Workload             = Workload,
                });
            }

            await context.DelayBy(Duration);

            context.Logger.LogInformation($"Entering Cooldown.");

            await context.DelayBy(Cooldown);

            context.Logger.LogInformation($"Experiment complete.");

            context.GlobalShutdown();

            return(UnitType.Value);
        }
Esempio n. 2
0
        public async Task <UnitType> Execute(IOrchestrationContext context)
        {
            await context.DelayBy(Delay);

            context.ForkOrchestration(Orchestration);

            return(UnitType.Value);
        }
        public async Task <UnitType> Execute(IOrchestrationContext context)
        {
            await context.DelayBy(Delay);

            await context.PerformActivity(Activity);

            return(UnitType.Value);
        }