Example #1
0
        public void PopulateForBundle(string bundleId)
        {
            lock (sync) {
                dumps.TryAdd(bundleId, new ConcurrentDictionary <string, DumpMetainfo>());
                foreach (var dumpInfo in storage.ReadDumpMetainfoForBundle(bundleId))
                {
                    dumps[bundleId][dumpInfo.DumpId] = dumpInfo;

                    if (!dumpInfo.Is64Bit.HasValue)
                    {
                        // this is done for repos, which did not store bitness information yet
                        // be aware that this will slow down startup considerable.
                        var res = storage.ReadResults(bundleId, dumpInfo.DumpId);
                        if (res != null)
                        {
                            dumpInfo.Is64Bit = res.SystemContext.ProcessArchitecture.Contains("64");
                            storage.Store(dumpInfo);
                        }
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Older storage did not have metainfo files. We need to read full results, create new metainfo file and store it.
        /// </summary>
        /// <param name="bundleId"></param>
        private async Task CreateBundleMetainfoForCompat(string bundleId)
        {
            var metainfo = new BundleMetainfo()
            {
                BundleId = bundleId
            };
            // use storage directly, not repo. repo might not be initialized yet
            // back then, every dump had the same information encoded. take the first dump and use it from there.

            var dumps = await dumpStorage.ReadDumpMetainfoForBundle(bundleId);

            // loop through all dumps and hope to find a good one.
            foreach (var dump in dumps)
            {
                if (dump != null)
                {
                    metainfo.Created  = dump.Created;
                    metainfo.Finished = dump.Created;                     // can't do better.
                    metainfo.Status   = BundleStatus.Finished;
                    var fullresult = await dumpStorage.ReadResults(bundleId, dump.DumpId);

                    if (fullresult != null)
                    {
                        if (!string.IsNullOrEmpty(fullresult.AnalysisInfo.JiraIssue))
                        {
                            metainfo.CustomProperties["ref"] = fullresult.AnalysisInfo.JiraIssue;
                        }
                        if (!string.IsNullOrEmpty(fullresult.AnalysisInfo.FriendlyName))
                        {
                            metainfo.CustomProperties["note"] = fullresult.AnalysisInfo.FriendlyName;
                        }
                        break;
                    }
                }
            }
            WriteMetainfoFile(metainfo, pathHelper.GetBundleMetadataPath(bundleId));
        }
Example #3
0
 internal SDResult GetResult(string bundleId, string dumpId, out string error)
 {
     return(storage.ReadResults(bundleId, dumpId, out error));
 }
Example #4
0
 internal async Task <SDResult> GetResult(string bundleId, string dumpId)
 {
     return(await storage.ReadResults(bundleId, dumpId));
 }