Пример #1
0
        public async Task <ExperimentSummary[]> Update(string timelineName, params int[] experiments)
        {
            if (experiments == null)
            {
                throw new ArgumentNullException(nameof(experiments));
            }

            Trace.WriteLine("Downloading experiment results...");
            var all_summaries = await DownloadSummary(timelineName);

            Table        timeline = all_summaries.Item1;
            RecordsTable records  = all_summaries.Item2;
            string       etag     = all_summaries.Item3;

            foreach (var experimentId in experiments)
            {
                var exp = await storage.GetExperiment(experimentId); // fails if not found

                var domain = resolveDomain.GetDomain(exp.DomainName);

                var results = (await storage.GetResults(experimentId)).Benchmarks;

                Trace.WriteLine("Building summary for the experiment " + experimentId);
                var catSummary = ExperimentSummary.Build(results, domain, ExperimentSummary.DuplicateResolution.Ignore);
                var expSummary = new ExperimentSummary(experimentId, DateTimeOffset.Now, catSummary);
                timeline = ExperimentSummaryStorage.AppendOrReplace(timeline, expSummary);

                Trace.WriteLine("Updating records...");
                records.UpdateWith(results, domain);
            }

            await UploadSummary(timelineName, timeline, records, all_summaries.Item3);

            var resultfromTable = ExperimentSummaryStorage.LoadFromTable(timeline);

            Array.Sort(resultfromTable, (el1, el2) => DateTimeOffset.Compare(el2.Date, el1.Date));
            return(resultfromTable);
        }
 public override async Task <ExperimentResults> GetResults(ExperimentID id, BenchmarkFilter f = null)
 {
     return(await storage.GetResults(id, f));
 }
 public override async Task <ExperimentResults> GetResults(ExperimentID id)
 {
     return(await storage.GetResults(id));
 }