Exemplo n.º 1
0
        public void GetLoadProviderTest()
        {
            LoadProviderManager loadProviderManager = new LoadProviderManager();
            TestModel           testModel           = JsonConvert.DeserializeObject <TestModel>(TestData);
            ILoadProvider       loadProvider        = loadProviderManager.GetLoadProvider(testModel.Type, testModel.Name, testModel.Context);

            Assert.IsType <StorageLoadProvider>(loadProvider);

            ILoadProvider loadProviderNull = loadProviderManager.GetLoadProvider("asdasd", testModel.Name, testModel.Context);

            Assert.Null(loadProviderNull);

            ILoadProvider loadProviderExists = loadProviderManager.GetLoadProvider(testModel.Type, testModel.Name, testModel.Context);

            Assert.Equal(loadProvider, loadProviderExists);
        }
        public KerriganSystemController(Bootstrap bootstrap, IHostedMachine hostedMachine)
            : base(bootstrap)
        {
            var entrance = new MessageEntrance(bootstrap.GetMessageQueueFromVariableSet("Entrance"));

            MetricCollections.Default.AddMetricCollector("idle", new IncreasedMetricCollector("KerriganIdle"));
            MetricCollections.Default.AddMetricCollector("busy", new IncreasedMetricCollector("KerriganBusy"));
            this.loadProviderManager = new LoadProviderManager();
            this.WorkingProcessor    = new LoadIntegration(
                bootstrap.GetCachedFromVariableSet("HeartbeatCache"),
                bootstrap.GetStorageFromVariableSet("CoreStorage"),
                this.loadProviderManager
                );
            IMessageTermination messageTermination = new MessageTermination(bootstrap, this);

            messagePipline     = new MessagePipline(entrance, messageTermination);
            messageOut         = bootstrap.GetMessageQueueFromVariableSet("Termination");
            this.hostedMachine = hostedMachine;
        }