<% events.each_with_index do |event, index| %>
<%
skip = excluded_objects.include?(event[:object]) || "#{event[:object]}".match(/^#/)
cumulatives[event[:call]] ||= {:duration => 0.0, :count => 0}
cumulatives[event[:call]][:duration] += event[:duration]
cumulatives[event[:call]][:count] += 1
cumulatives[event[:call]][:average] = cumulatives[event[:call]][:duration].to_f / cumulatives[event[:call]][:count].to_f
corrections.size.times do |i|
event[:depth] <= corrections[0] ? corrections.shift : break
end
%>
<% if skip %>
<% corrections.unshift event[:depth] if corrections.empty? || corrections.first != event[:depth] %>
<% else %>
<% if current_depth < event[:depth] - corrections.size %>
<% elsif current_depth > event[:depth] - corrections.size %>
<%= "
" * (current_depth - (event[:depth] - corrections.size)) %>
<% end %>
<%= "%.6f" % event[:time] %>
<%= "%.6f" % event[:duration] %>
<%= " " * (event[:depth] - corrections.size) %>
<% if (next_event = events[index + 1]) && next_event[:depth] > event[:depth] %>
<%= event[:call] %>
<% else %>
<%= event[:call] %>
<% end %>
<% current_depth = event[:depth] - corrections.size %>
<% end %>
<% end %>
<%= "