Beispiel #1
0
 public CallTreeData(ISymbolServerArtifactRetriever symbolServerArtifactRetriever, ISourceServerAuthorizationInformationProvider sourceServerInformationProvider, EtwDeserializer deserializer, StackViewerModel model)
 {
     this.symbolServerArtifactRetriever   = symbolServerArtifactRetriever;
     this.sourceServerInformationProvider = sourceServerInformationProvider;
     this.deserializer = deserializer;
     this.model        = model;
 }
Beispiel #2
0
 private bool Equals(StackViewerModel other)
 {
     return(string.Equals(this.Filename, other.Filename) &&
            string.Equals(this.Pid, other.Pid) &&
            string.Equals(this.StackType, other.StackType) &&
            string.Equals(this.Start, other.Start) &&
            string.Equals(this.End, other.End) &&
            string.Equals(this.GroupPats, other.GroupPats) &&
            string.Equals(this.IncPats, other.IncPats) &&
            string.Equals(this.ExcPats, other.ExcPats) &&
            string.Equals(this.FoldPats, other.FoldPats) &&
            string.Equals(this.FoldPct, other.FoldPct));
 }
Beispiel #3
0
        public async ValueTask <ICallTreeData> GetCallTreeAsync(StackViewerModel model)
        {
            await this.EnsureInitialized();

            lock (this.callTreeDataCache)
            {
                if (!this.callTreeDataCache.TryGetValue(model, out var value))
                {
                    value = new CallTreeData(this.symbolServerArtifactRetriever, this.sourceServerAuthorizationInformationProvider, this.deserializer, model);
                    this.callTreeDataCache.Add(model, value);
                }

                return(value);
            }
        }
Beispiel #4
0
        public IDeserializedData GetData(StackViewerModel model)
        {
            lock (this.cache)
            {
                if (!this.cache.TryGetValue(model.Filename, out IDeserializedData data))
                {
                    var cacheEntryOptions = new MemoryCacheEntryOptions().SetPriority(CacheItemPriority.NeverRemove).RegisterPostEvictionCallback(callback: EvictionCallback, state: this).SetSlidingExpiration(this.cacheExpirationTimeProvider.Expiration);
                    data = new DeserializedData(model.Filename, model.LocationType, this.sourceServerAuthorizationInformationProvider, this.symbolServerArtifactRetriever, this.stackViewerSettings.Value.TemporaryDataFileDownloadLocation);
                    this.cache.Set(model.Filename, data, cacheEntryOptions);
                    CacheMonitorEventSource.Logger.CacheEntryAdded(Environment.MachineName, model.Filename);
                }

                return(data);
            }
        }
Beispiel #5
0
 public StackViewerController(IDeserializedDataCache dataCache, StackViewerModel model)
 {
     this.dataCache = dataCache;
     this.model     = model;
 }