Exemple #1
0
            public override void RunWithFarm(MITP.ControllerFarmService farm)
            {
                try
                {
                    string farmId = ConfigurationManager.AppSettings[MITP.ControllerFarmService.FARMID_PARAM_NAME];

                    Resource[] data = null;
                    ResourceBaseServiceClient client = null;
                    try
                    {
                        client = new ResourceBaseServiceClient();
                        data   = client.GetResourcesForFarm(farmId, null);
                    }
                    catch (Exception ex)
                    {
                        Common.Utility.LogError(" Failed to get resources from ResourceBaseService. Exception: " + ex);
                        throw ex;
                    }
                    finally
                    {
                        client.Close();
                    }


                    var resourceCollector = base.GetResourceCacheCollector(data);
                    var taskCollector     = base.GetTaskCacheCollector();

                    Utility.CreateAndRunRepeatedProcess(5000, false, () =>
                    {
                        Common.Utility.ExceptionablePlaceWrapper(() =>
                        {
                            foreach (var resource in data)
                            {
                                resourceCollector.push(resource.ResourceName, GenerateResourecMockData(resource));
                            }
                        },
                                                                 "Exception while creating and pushing resources mock data in MockCacheCollectorFactory",
                                                                 " Mock statistic data for resources have been generated and pushed", false);
                    });
                }
                catch (Exception ex)
                {
                    Common.Utility.LogError("failed to reinitialize collecting data", ex);
                }
            }
Exemple #2
0
 //for mock
 public virtual void RunWithFarm(MITP.ControllerFarmService farm)
 {
 }