Exemple #1
0
        private async Task<ChartSet> ErrorsInTheMiddle(string key)
        {
            _testConfigProvider.Set("mjolnir.breaker." + key + ".minimumOperations", 5);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".thresholdPercentage", 50);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".trippedDurationMillis", 5000);
            _testConfigProvider.Set("mjolnir.metrics." + key + ".windowMillis", 10000);

            // Cranked up the threads here. We're going to sleeping on the server just a bit longer than
            // the timeout, so there's potential for server threads to grow while we throw more requests
            // at them.
            using (var server = new HttpServer(1))
            {
                var url = string.Format("http://*****:*****@"c:\hudl\logs\mjolnir-metrics-{0}-{1}.txt", key, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")), _testStats.Metrics.Select(m => m.ToCsvLine()));

            return new ChartSet
            {
                Name = "Error for 5s",
                Description = "30s @ 5/sec.<br/>Command: Inherited<br/>Timeout: 10000<br/>Server: 500 for 5 seconds in the middle<br/>Breaker: 50% / 10sec, min 5 ops, 5s tripped",
                Charts = GatherChartData(_testStats.Metrics, key, key + ".HttpClient"),
            };
        }
Exemple #2
0
        private async Task<ChartSet> IdealCommandAttribute(string key)
        {
            _testConfigProvider.Set("mjolnir.breaker." + key + ".minimumOperations", 5);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".thresholdPercentage", 50);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".trippedDurationMillis", 5000);
            _testConfigProvider.Set("mjolnir.metrics." + key + ".windowMillis", 10000);

            // Command timeout is defined on the interface.
            var instance = new HttpClientService();
            var proxy = CommandInterceptor.CreateProxy<IHttpClientService>(instance);

            using (var server = new HttpServer(1))
            {
                var url = string.Format("http://*****:*****@"c:\hudl\logs\mjolnir-metrics-{0}-{1}.txt", key, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")), _testStats.Metrics.Select(m => m.ToCsvLine()));

            return new ChartSet
            {
                Name = "Ideal (Command Attribute)",
                Description = "30s @ 5/sec.<br/>Command: Inherited<br/>Timeout: 10000<br/>Server: Immediate 200<br/>Breaker: 50% / 10sec, min 5 ops, 5s tripped",
                Charts = GatherChartData(_testStats.Metrics, key, key + ".IHttpClientService-MakeRequest"),
            };
        }
Exemple #3
0
        private async Task<ChartSet> FastFailures(string key)
        {
            _testConfigProvider.Set("mjolnir.breaker." + key + ".minimumOperations", 5);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".thresholdPercentage", 50);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".trippedDurationMillis", 5000);
            _testConfigProvider.Set("mjolnir.metrics." + key + ".windowMillis", 10000);

            using (var server = new HttpServer(1))
            {
                var url = string.Format("http://*****:*****@"c:\hudl\logs\mjolnir-metrics-{0}-{1}.txt", key, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")), _testStats.Metrics.Select(m => m.ToCsvLine()));

            return new ChartSet
            {
                Name = "Fast Failures",
                Description = "30s @ 5/sec.<br/>Command: Inherited<br/>Timeout: 30000<br/>Server: Immediate 500<br/>Breaker: 50% / 10sec, min 5 ops, 5s tripped",
                Charts = GatherChartData(_testStats.Metrics, key, key + ".HttpClient"),
            };
        }
Exemple #4
0
        private async Task <ChartSet> ErrorsInTheMiddle(string key)
        {
            _testConfigProvider.Set("mjolnir.breaker." + key + ".minimumOperations", 5);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".thresholdPercentage", 50);
            _testConfigProvider.Set("mjolnir.breaker." + key + ".trippedDurationMillis", 5000);
            _testConfigProvider.Set("mjolnir.metrics." + key + ".windowMillis", 10000);

            // Cranked up the threads here. We're going to sleeping on the server just a bit longer than
            // the timeout, so there's potential for server threads to grow while we throw more requests
            // at them.
            using (var server = new HttpServer(1))
            {
                var url = string.Format("http://*****:*****@"c:\hudl\logs\mjolnir-metrics-{0}-{1}.txt", key, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")), _testStats.Metrics.Select(m => m.ToCsvLine()));

            return(new ChartSet
            {
                Name = "Error for 5s",
                Description = "30s @ 5/sec.<br/>Command: Inherited<br/>Timeout: 10000<br/>Server: 500 for 5 seconds in the middle<br/>Breaker: 50% / 10sec, min 5 ops, 5s tripped",
                Charts = GatherChartData(_testStats.Metrics, key, key + ".HttpClient"),
            });
        }