internal void StopScan(StreamscanrequestStartArgs_V1TraceData data) { // Get the requesting user process based on the PID logged inside the engine. TraceProcess process = _traceLog.Processes.GetProcess(data.PID, data.TimeStampRelativeMSec); ProcessIndex processIndex = process.ProcessIndex; if (processIndex == ProcessIndex.Invalid) { return; } // Get the file scan operation. Dictionary <ThreadIndex, FileScanOperation> processContainer = GetOrCreateProcessContainer(processIndex); FileScanOperation operation = processContainer.Values.Where(s => s.File.Equals(data.Path, System.StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (operation != null) { operation.StopTimeRelativeMSec = data.TimeStampRelativeMSec; // Create the stack. StackSourceFrameIndex fileNodeIndex = _stackSource.Interner.FrameIntern($"File ({operation.File})"); StackSourceFrameIndex reasonNodeIndex = _stackSource.Interner.FrameIntern($"Reason ({(operation.Reason != null ? operation.Reason : "Unknown")})"); StackSourceFrameIndex resultNodeIndex = _stackSource.Interner.FrameIntern($"Scan Result ({operation.Result})"); _sample.StackIndex = _stackSource.Interner.CallStackIntern(resultNodeIndex, operation.RequestorStack); _sample.StackIndex = _stackSource.Interner.CallStackIntern(reasonNodeIndex, _sample.StackIndex); _sample.StackIndex = _stackSource.Interner.CallStackIntern(fileNodeIndex, _sample.StackIndex); _sample.Metric = (float)(operation.StopTimeRelativeMSec - operation.StartTimeRelativeMSec); _sample.TimeRelativeMSec = operation.StartTimeRelativeMSec; _stackSource.AddSample(_sample); } }
internal void StartScan(StreamscanrequestStartArgs_V1TraceData data) { // Get the requesting user process based on the PID logged inside the engine. TraceProcess process = _traceLog.Processes.GetProcess(data.PID, data.TimeStampRelativeMSec); ProcessIndex processIndex = process.ProcessIndex; if (processIndex == ProcessIndex.Invalid) { return; } // Get the file scan operation. Dictionary <ThreadIndex, FileScanOperation> processContainer = GetOrCreateProcessContainer(processIndex); FileScanOperation operation = processContainer.Values.Where(s => s.File.Equals(data.Path, System.StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (operation != null) { operation.StartTimeRelativeMSec = data.TimeStampRelativeMSec; _engineThreadToScanMap[(int)data.Thread().ThreadIndex] = operation; } }