コード例 #1
0
 public ShowResultsViewModel(ExperimentStatusViewModel st, string sharedDirectory, ExperimentManager manager,
                             AzureExperimentManagerViewModel managerVm, ExperimentListViewModel experimentsVm, RecentValuesStorage recentValues, IUIService uiService)
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     if (managerVm == null)
     {
         throw new ArgumentNullException(nameof(managerVm));
     }
     if (uiService == null)
     {
         throw new ArgumentNullException("uiService");
     }
     if (experimentsVm == null)
     {
         throw new ArgumentNullException(nameof(experimentsVm));
     }
     this.manager               = manager;
     this.managerVm             = managerVm;
     this.experimentsVm         = experimentsVm;
     this.uiService             = uiService;
     this.statusVm              = st;
     this.id                    = st.ID;
     this.sharedDirectory       = sharedDirectory;
     this.benchmarkTimeout      = st.Definition.BenchmarkTimeout;
     this.jobStatus             = ExperimentExecutionStateVM.Loading;
     this.benchmarkContainerUri = st.Definition.BenchmarkContainerUri;
     this.recentValues          = recentValues;
     RefreshResultsAsync();
 }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();

            recentValues          = new RecentValuesStorage();
            connectionString.Text = recentValues.ConnectionString;

            ProgramStatusViewModel statusVm = new ProgramStatusViewModel();

            statusBar.DataContext = statusVm;
            uiService             = new UIService(statusVm);
        }
        public async void RequeueIErrors(ExperimentStatusViewModel[] ids, RecentValuesStorage recentValues)
        {
            var handle       = uiService.StartIndicateLongOperation("Requeue infrastructure errors...");
            int requeueCount = 0;

            try
            {
                for (int i = 0; i < ids.Length; i++)
                {
                    int eid     = ids[i].ID;
                    var results = await manager.GetResults(eid);

                    var ieResults = results.Benchmarks.Where(r => r.Status == Measurement.ResultStatus.InfrastructureError).Select(r => r.BenchmarkFileName).Distinct();
                    if (ieResults.Count() > 0)
                    {
                        string benchmarkCont = ids[i].Definition.BenchmarkContainerUri;
                        RequeueSettingsViewModel requeueSettingsVm = new RequeueSettingsViewModel(benchmarkCont, this, recentValues, uiService);
                        requeueSettingsVm = uiService.ShowRequeueSettings(requeueSettingsVm);
                        if (requeueSettingsVm != null)
                        {
                            manager.BatchPoolID = requeueSettingsVm.Pool;
                            await manager.RestartBenchmarks(eid, ieResults, requeueSettingsVm.BenchmarkContainerUri);

                            requeueCount += ieResults.Count();
                        }
                    }
                }
                uiService.ShowInfo("Requeued " + requeueCount + " infrastructure errors.", "Infrastructure errors");
            }
            catch (Exception ex)
            {
                uiService.ShowError(ex, "Failed to requeue infrastructure errors");
            }
            finally
            {
                uiService.StopIndicateLongOperation(handle);
            }
        }
コード例 #4
0
 public RequeueSettingsViewModel(string benchmarkContainerUri, AzureExperimentManagerViewModel managerVm, RecentValuesStorage recentValues, IUIService uiService)
 {
     if (managerVm == null)
     {
         throw new ArgumentNullException(nameof(managerVm));
     }
     if (uiService == null)
     {
         throw new ArgumentNullException(nameof(uiService));
     }
     if (recentValues == null)
     {
         throw new ArgumentNullException(nameof(recentValues));
     }
     this.managerVm                       = managerVm;
     this.service                         = uiService;
     this.recentValues                    = recentValues;
     this.benchmarkContainerUri           = benchmarkContainerUri;
     isNotDefaultBenchmarkContainerUri    = benchmarkContainerUri != ExperimentDefinition.DefaultContainerUri;
     this.benchmarkContainerUriNotDefault = isNotDefaultBenchmarkContainerUri ? benchmarkContainerUri : "";
     isChosenDefaultContainer             = benchmarkContainerUri == ExperimentDefinition.DefaultContainerUri;
     ChoosePoolCommand                    = new DelegateCommand(ListPools);
     selectedPool                         = recentValues.BatchPool;
 }
 public ShowResultsViewModel BuildResultsView(ExperimentStatusViewModel st, string directory, ExperimentListViewModel experimentsVm, RecentValuesStorage recentValues)
 {
     return(new ShowResultsViewModel(st, directory, manager, this, experimentsVm, recentValues, uiService));
 }
コード例 #6
0
        public NewExperimentViewModel(AzureExperimentManagerViewModel manager, IUIService service, RecentValuesStorage recentValues, string creator, IDomainResolver domainResolver)
        {
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }
            if (recentValues == null)
            {
                throw new ArgumentNullException(nameof(recentValues));
            }
            if (domainResolver == null)
            {
                throw new ArgumentNullException(nameof(domainResolver));
            }
            this.manager        = manager;
            this.service        = service;
            this.recentValues   = recentValues;
            this.creator        = creator;
            this.domainResolver = domainResolver;

            benchmarkContainerUri           = ExperimentDefinition.DefaultContainerUri;
            benchmarkContainerUriNotDefault = "";
            isDefaultBenchmarkContainerUri  = true;
            ChooseDirectoryCommand          = new DelegateCommand(ChooseDirectory);
            ChooseCategoriesCommand         = new DelegateCommand(ChooseCategories);
            ChooseExecutableCommand         = new DelegateCommand(ChooseExecutable);
            ChoosePoolCommand = new DelegateCommand(ListPools);

            benchmarkDirectory = recentValues.BenchmarkDirectory;
            categories         = recentValues.BenchmarkCategories;
            timelimit          = recentValues.BenchmarkTimeLimit.TotalSeconds;
            exptimelimit       = recentValues.ExperimentTimeLimit.TotalSeconds;
            memlimit           = recentValues.BenchmarkMemoryLimit;
            note = recentValues.ExperimentNote;
            allowAdaptiveRuns      = recentValues.AllowAdaptiveRuns;
            maxRepetitions         = recentValues.MaxRepetitions;
            maxTimeForAdaptiveRuns = recentValues.MaxTimeForAdaptiveRuns;

            Domain = Domains[0];
            // Following will override the defaults given when setting the Domain above.
            string storedExt = recentValues.BenchmarkExtension;

            if (!string.IsNullOrEmpty(storedExt))
            {
                extension = storedExt;
            }
            string storedParam = recentValues.ExperimentExecutableParameters;

            if (!string.IsNullOrEmpty(storedParam))
            {
                parameters = storedParam;
            }


            UseMostRecentExecutable = true;
            RecentBlobDisplayName   = "searching...";
            taskRecentBlob          = FindRecentExecutable();

            selectedPool = recentValues.BatchPool;
        }