Exemple #1
0
        GivenAQueueWhoseStorageHasScaledOut()
        {
            var targetNumberOfShards                 = 3;
            var scaleUpThresholdPercentage           = 1;
            var initialQueueStorageCapacityMegabytes = 1024; // 1 GB
            var homepage = this.WebBrowser.NavigateTo <Homepage>();

            // Configure so it doesn't take much to hit the threshold.
            var createQueueParams = new CreateQueueParameters(
                queueName:                  "scaled-test-queue",
                storageCapacityMegabytes:   initialQueueStorageCapacityMegabytes,
                scaleUpThresholdPercentage: scaleUpThresholdPercentage
                );

            // Create it!
            QueueSteps.ContextSet(homepage
                                  .CreateQueueForm
                                  .CreateQueue(createQueueParams));

            // Calculate amount of data needed to generate to fill 3 shards.
            var megabytesToScale = (int)(initialQueueStorageCapacityMegabytes * (scaleUpThresholdPercentage / 100D)) * targetNumberOfShards;

            // Submit data
            var sentCount = QueueSteps.ContextGet <ManageQueueSection>()
                            .QueueClient
                            .FillQueue(sizeMegabytes: megabytesToScale);

            QueueSteps.ContextSet(sentCount, nameof(sentCount));
        }
Exemple #2
0
        GivenAQueueWithStorageUtilizationScaleUpThresholdSet()
        {
            var homepage = this.WebBrowser.NavigateTo <Homepage>();

            // Configure so it doesn't take much to hit the threshold.
            var createQueueParams = new CreateQueueParameters(
                "test-queue",
                storageCapacityMegabytes:   1024,
                scaleUpThresholdPercentage: 1
                );

            var manageQueueSection = homepage
                                     .CreateQueueForm
                                     .CreateQueue(createQueueParams);

            QueueSteps.ContextSet(createQueueParams);
            QueueSteps.ContextSet(manageQueueSection);
        }
Exemple #3
0
        GivenAQueueWhoseStorageHasScaledOut()
        {
            var targetNumberOfShards                 = 3;
            var scaleUpThresholdPercentage           = 1;
            var initialQueueStorageCapacityMegabytes = 1024; // 1 GB
            var homepage                             = this.WebBrowser.NavigateTo<Homepage>();

            // Configure so it doesn't take much to hit the threshold.
            var createQueueParams = new CreateQueueParameters(
                queueName:                  "scaled-test-queue",
                storageCapacityMegabytes:   initialQueueStorageCapacityMegabytes,
                scaleUpThresholdPercentage: scaleUpThresholdPercentage
            );

            // Create it!
            QueueSteps.ContextSet(homepage
                .CreateQueueForm
                .CreateQueue(createQueueParams));

            // Calculate amount of data needed to generate to fill 3 shards.
            var megabytesToScale = (int)(initialQueueStorageCapacityMegabytes * (scaleUpThresholdPercentage / 100D)) * targetNumberOfShards;

            // Submit data
            var sentCount = QueueSteps.ContextGet<ManageQueueSection>()
                .QueueClient
                .FillQueue(sizeMegabytes: megabytesToScale);

            QueueSteps.ContextSet(sentCount, nameof(sentCount));
        }
Exemple #4
0
        GivenAQueueWithStorageUtilizationScaleUpThresholdSet()
        {
            var homepage = this.WebBrowser.NavigateTo<Homepage>();

            // Configure so it doesn't take much to hit the threshold.
            var createQueueParams = new CreateQueueParameters(
                "test-queue",
                storageCapacityMegabytes:   1024,
                scaleUpThresholdPercentage: 1
            );

            var manageQueueSection = homepage
                .CreateQueueForm
                .CreateQueue(createQueueParams);

            QueueSteps.ContextSet(createQueueParams);
            QueueSteps.ContextSet(manageQueueSection);
        }