public async void RequeueResults(BenchmarkResultViewModel[] items)
        {
            string[] benchmarkNames = items.Select(e => e.Filename).Distinct().ToArray();

            RequeueSettingsViewModel requeueSettingsVm = new RequeueSettingsViewModel(benchmarkContainerUri, managerVm, recentValues, uiService);

            requeueSettingsVm = uiService.ShowRequeueSettings(requeueSettingsVm);
            if (requeueSettingsVm != null)
            {
                var handle = uiService.StartIndicateLongOperation("Requeue experiment results...");
                try
                {
                    manager.BatchPoolID = requeueSettingsVm.Pool;
                    await manager.RestartBenchmarks(id, benchmarkNames, requeueSettingsVm.BenchmarkContainerUri);

                    RefreshJobStatus();
                    experimentsVm.Refresh();
                    uiService.ShowInfo(string.Format("{0} benchmark(s) requeued.", benchmarkNames.Length));
                }
                catch (Exception ex)
                {
                    uiService.ShowError(ex.Message, "Failed to requeue experiment results");
                }
                finally
                {
                    uiService.StopIndicateLongOperation(handle);
                }
            }
        }
Esempio n. 2
0
        public RequeueSettingsViewModel ShowRequeueSettings(RequeueSettingsViewModel vm)
        {
            RequeueSettings dlg = new RequeueSettings();

            dlg.DataContext = vm;
            if (dlg.ShowDialog() == true)
            {
                vm.SaveRecentSettings();
                return(dlg.DataContext as RequeueSettingsViewModel);
            }
            else
            {
                return(null);
            }
        }
        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);
            }
        }