<% now = Time.now %> <% queries.each do |query| %> <% end %>
Pid State Duration Source
<%= query["pid"] %> <%= query["state"] %> <%= query["started_at"] ? "#{number_with_delimiter(((now - Time.parse(query["started_at"])) * 1000).round)} ms" : nil %> <%= query["source"] %> <%= query["user"] %> <%= button_to "Explain", explain_path(query: query["query"]), form: {target: "_blank"}, class: "btn btn-info" %> <%= button_to "Kill", kill_path(pid: query["pid"]), class: "btn btn-danger" %>
<%= query["query"] %>