Example #1
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"),
            });
        }
Example #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"),
            };
        }