Skip to content

Commit

Permalink
Fix the Contention Stacks view for .NET Framework and older .NET Core (
Browse files Browse the repository at this point in the history
…#2038)

processes.

This change will use the time difference between the Contention/Start
and Contention/Stop event unless the process is running on a newer
version of .NET Core that specifies the time difference in the
Contention/Stop event.  This is the ensure that this view works for all
.NET processes and not just newer .NET Core processes.
  • Loading branch information
brianrob authored May 28, 2024
1 parent b834e69 commit a662474
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/TraceEvent/Computers/StartStopLatencyComputer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ protected override void RecordAdditionalDataOnStartWithoutStop(StackSourceSample
protected override void RecordAdditionalStopData(StackSourceSample sample, TraceEvent data)
{
var stopData = (ContentionStopTraceData) data;
sample.Metric = (float) (stopData.DurationNs / NanosInMillisecond);
if (stopData.DurationNs > 0)
{
sample.Metric = (float)(stopData.DurationNs / NanosInMillisecond);
}
sample.StackIndex = _interner.CallStackIntern(_interner.FrameIntern($"EventData DurationNs {stopData.DurationNs:N0}"), sample.StackIndex);
}
}
Expand Down

0 comments on commit a662474

Please sign in to comment.