Example #1
0
        public RuntimeStatusInfo(SessionStateHandle stateHandle, ulong statusIndex, List <string> failedInfos, IDictionary <IVariable, string> watchDatas)
        {
            this.Properties = new SerializableMap <string, object>(Constants.DefaultRuntimeSize);
            this.SessionId  = stateHandle.Session;

            this.CallStacks    = new List <ICallStack>(stateHandle.SequenceCount);
            this.SequenceState = new List <RuntimeState>(stateHandle.SequenceCount);

            this.StatusIndex  = statusIndex;
            this.StartGenTime = stateHandle.StartGenTime;
            this.EndGenTime   = stateHandle.EndGenTime;
            this.StartTime    = stateHandle.StartTime;
            this.ElapsedTime  = stateHandle.ElapsedTime;
            this.CurrentTime  = stateHandle.CurrentTime;
            if (null != stateHandle.Performance)
            {
                this.MemoryUsed      = stateHandle.Performance.MemoryUsed;
                this.MemoryAllocated = stateHandle.Performance.MemoryAllocated;
                this.ProcessorTime   = stateHandle.Performance.ProcessorTime;
            }
            this.State = stateHandle.State;

            for (int i = 0; i < stateHandle.SequenceCount; i++)
            {
                CallStacks.Add(stateHandle[i].RunStack);
                SequenceState.Add(stateHandle[i].State);
            }
            this.FailedInfos = failedInfos;
            this.WatchDatas  = watchDatas;
        }
Example #2
0
        public RuntimeStatusInfo(SessionStateHandle stateHandle, ulong statusIndex, Dictionary <int, string> failedInfos,
                                 IDictionary <IVariable, string> watchDatas, PerformanceData performance,
                                 Dictionary <ICallStack, StepResult> stepResults)
        {
            this.Properties = new SerializableMap <string, object>(Constants.DefaultRuntimeSize);
            this.SessionId  = stateHandle.Session;

            this.CallStacks    = new List <ICallStack>(stateHandle.SequenceCount);
            this.SequenceState = new List <RuntimeState>(stateHandle.SequenceCount);

            this.StatusIndex  = statusIndex;
            this.StartGenTime = stateHandle.StartGenTime;
            this.EndGenTime   = stateHandle.EndGenTime;
            this.StartTime    = stateHandle.StartTime;
            this.ElapsedTime  = stateHandle.ElapsedTime;
            this.CurrentTime  = stateHandle.CurrentTime;
            if (null != performance)
            {
                this.MemoryUsed      = performance.MemoryUsed;
                this.MemoryAllocated = performance.MemoryAllocated;
                this.ProcessorTime   = performance.ProcessorTime;
            }
            this.State = stateHandle.State;

            foreach (int sequenceIndex in stateHandle.SequenceIndexes)
            {
                CallStacks.Add(stateHandle[sequenceIndex].RunStack);
                SequenceState.Add(stateHandle[sequenceIndex].State);
            }
            if (null != failedInfos)
            {
                this.FailedInfos = new Dictionary <int, IFailedInfo>(failedInfos.Count);
                foreach (KeyValuePair <int, string> keyValuePair in failedInfos)
                {
                    this.FailedInfos.Add(keyValuePair.Key, new FailedInfo(keyValuePair.Value));
                }
            }
            StepResults     = stepResults;
            this.WatchDatas = watchDatas;
        }