Ejemplo n.º 1
0
        //private IDictionary<object, object> GetLayerProperties()
        //{
        //    var endTime = DateTime.Now;
        //    var layerProperties = GetProperties();
        //    layerProperties[LayerIdKeyName] = Id;
        //    layerProperties[ParentLayerIdKeyName] = ParentContext?.Scope.Id;
        //    layerProperties[RootLayerIdKeyName] = RootId;
        //    layerProperties["scope(startTime)"] = StartTime;
        //    layerProperties["scope(endTime)"] = endTime;
        //    layerProperties["scope(raw duration)"] = (int) endTime.Subtract(StartTime).TotalMilliseconds;
        //    layerProperties["scope(has parallel child)"] = _parallelScopeContext.HasChildren;
        //    layerProperties["scope(pure duration)"] =
        //        (int) (endTime.Subtract(StartTime).Subtract(_sequentialScopeContext.Duration)).TotalMilliseconds;
        //    return layerProperties;
        //}

        private void Close()
        {
            _connection.CloseScope(Id);
            _contextProvider.SetScopeContextAsCurrent(ParentContext);
            ParentContext?.NotifyLayerDisposed(this);
            ParentContext         = null;
            _parallelScopeContext = null;
            _parallelScopeContext = null;
            _currentContext       = null;
        }
Ejemplo n.º 2
0
 public ITracedScope SetParallelChildrenMode()
 {
     _currentContext = _parallelScopeContext ?? (_parallelScopeContext = new ParallelScopeContext(this));
     _contextProvider.SetScopeContextAsCurrent(_currentContext);
     return(this);
 }