Exemplo n.º 1
0
        private async Task BuildStatistics()
        {
            var handle = ui.StartIndicateLongOperation("Loading statistics for the experiment...");

            try
            {
                statistics = await Task.Run(() => GetStatistics(manager, id, domain));
            }
            finally
            {
                ui.StopIndicateLongOperation(handle);
            }
            NotifyPropertyChanged("Sat");
            NotifyPropertyChanged("Unsat");
            NotifyPropertyChanged("Unknown");
            NotifyPropertyChanged("Overperformed");
            NotifyPropertyChanged("Underperformed");
            NotifyPropertyChanged("ProblemBug");
            NotifyPropertyChanged("ProblemNonZero");
            NotifyPropertyChanged("ProblemTimeout");
            NotifyPropertyChanged("ProblemMemoryout");
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------------------------------//

        protected void btnDownloadStatistics_Click(object sender, EventArgs e)
        {
            // Set the content type of the file to be downloaded
            Response.ContentType = Consts.StrRsp_ContentType_TextXml;

            // Clear all response headers
            Response.Clear();

            // Add response header
            Response.AddHeader(Consts.StrRsp_Disposition, Consts.StrRsp_Attachment_ExperimentStatisticsXml);

            //
            // Retrieve all experiment results, convert to XML and write out
            //
            ExperimentStatistics experimentStatistics = new ExperimentStatistics();
            string xmlExperimentStatistics            = experimentStatistics.RetrieveAllToXml();

            Response.Write(xmlExperimentStatistics);

            // End the http response
            Response.End();
        }
Exemplo n.º 3
0
        public static async void SaveMetaCSV(string filename, ExperimentStatusViewModel[] experiments, ExperimentManager manager, IDomainResolver domainResolver, IUIService uiService)
        {
            if (filename == null)
            {
                throw new ArgumentNullException("filename");
            }
            if (experiments == null)
            {
                throw new ArgumentNullException("experiments");
            }
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }
            if (domainResolver == null)
            {
                throw new ArgumentNullException("domain");
            }
            if (uiService == null)
            {
                throw new ArgumentNullException("uiService");
            }

            var handle = uiService.StartIndicateLongOperation("Save meta csv...");

            try
            {
                StreamWriter f = new StreamWriter(filename, false);
                f.WriteLine("\"ID\",\"# Total\",\"# SAT\",\"# UNSAT\",\"# UNKNOWN\",\"# Timeout\",\"# Memout\",\"# Bug\",\"# Error\",\"# Unique\",\"Parameters\",\"Note\"");
                var count = experiments.Length;
                var b     = new ExperimentResults[count];
                b = await DownloadResultsAsync(experiments, manager);

                var unique = computeUnique(experiments, b);
                for (var i = 0; i < count; i++)
                {
                    var    domain     = domainResolver.GetDomain(experiments[i].Definition.DomainName ?? "Z3");
                    var    aggr       = domain.Aggregate(b[i].Benchmarks.Select(r => new ProcessRunResults(new ProcessRunAnalysis(r.Status, r.Properties), r.CPUTime.TotalSeconds)));
                    var    statistics = new ExperimentStatistics(aggr);
                    var    def        = experiments[i].Definition;
                    string ps         = def.Parameters.Trim(' ');
                    string note       = experiments[i].Note.Trim(' ');
                    int?   sat        = statistics == null ? null : (int?)int.Parse(statistics.AggregatedResults.Properties[Z3Domain.KeySat], CultureInfo.InvariantCulture);
                    int?   unsat      = statistics == null ? null : (int?)int.Parse(statistics.AggregatedResults.Properties[Z3Domain.KeyUnsat], CultureInfo.InvariantCulture);
                    int?   unknown    = statistics == null ? null : (int?)int.Parse(statistics.AggregatedResults.Properties[Z3Domain.KeyUnknown], CultureInfo.InvariantCulture);
                    int?   bugs       = statistics == null ? null : (int?)statistics.AggregatedResults.Bugs;
                    int?   errors     = statistics == null ? null : (int?)statistics.AggregatedResults.Errors;
                    int?   timeouts   = statistics == null ? null : (int?)statistics.AggregatedResults.Timeouts;
                    int?   memouts    = statistics == null ? null : (int?)statistics.AggregatedResults.MemoryOuts;

                    f.WriteLine(experiments[i].ID + "," +
                                experiments[i].BenchmarksTotal + "," +
                                sat + "," +
                                unsat + "," +
                                unknown + "," +
                                timeouts + "," +
                                memouts + "," +
                                bugs + "," +
                                errors + "," +
                                unique[i] + "," +
                                "\"" + ps + "\"," +
                                "\"" + note + "\"");
                }
                f.WriteLine();
                f.Close();
            }
            catch (Exception ex)
            {
                uiService.ShowError(ex, "Failed to save meta CSV");
            }
            finally
            {
                uiService.StopIndicateLongOperation(handle);
            }
        }