in src/ServiceProfiler.EventPipe.Otel/Microsoft.ApplicationInsights.Profiler.Shared/Orchestrations/Scheduling/RandomSchedulingPolicy.cs [142:153]
private void MergeStandbyDuration(List<(TimeSpan duration, ProfilerAction action)> list, TimeSpan value)
{
int lastIndex = list.Count - 1;
if (list.Count > 0 && list[lastIndex].action == ProfilerAction.Standby)
{
list[lastIndex] = (list[lastIndex].duration.Add(value), ProfilerAction.Standby);
}
else
{
list.Add((value, ProfilerAction.Standby));
}
}