<commit_before><html>
<head>
<title>QueueStick Status Page</title>
<link rel="stylesheet" href="/stylesheets/reset-fonts-grids.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/main.css" type="text/css" />

<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
  $(document).ready(function () {
    $('li.error').click(function (event) {
      $('li.error-detail').hide();
      $('li#' + this.id + '-detail').slideDown('slow');

      event.preventDefault();
    });
  });
</script>
</head>
<body>
<div id="doc2" class="yui-t7">
  <div id="hd" class="divider" role="banner">
    <h1>queue_stick</h1>
    <div class="yui-g" id="header-container">
      <div class="yui-u first">
        <em>
          Job started by <span class="network"><%= @username %></span> <%= @start_time %><br />
          Current status: <span class="network"><%= @status %></span>
        </em></li>
      </div>
      <div class="yui-u">
        <em>Running on <span class="network"><%= @hostname %></span>, port <span class="network"><%= @port %></span></em>
      </div>
    </div>
  </div>
  <div id="bd" role="main">
    <div class="yui-g padded">
      <div class="yui-u first counters">
      <% @counters.each do |counter_name, info| %>
        <h2><%= readable_name(counter_name) %></h2>
        <table id="<%= counter_name %>" class="counter">
          <thead>
            <tr>
              <th>Thread</th>
              <% info[:names].each do |name| %>
                <th><%= name %></th>
              <% end %>
            </tr>
          </thead>
          <tbody>
            <% info[:workers].each do |worker_name, counts| %>
            <tr>
              <td class="blue"><%= h(worker_name) %></td>
              <% counts.each do |count| %>
              <td><%= count %></td>
              <% end %>
            </tr>
            <% end %>
          </tbody>
          <tfoot>
            <tr>
              <th class="left"><strong>Totals</strong></td>
              <% info[:totals].each do |total| %>
              <th><%= total %></th>
              <% end %>
            </tr>
          </tfoot>
        </table>
      <% end %>
      </div>
      <div class="yui-u">
        <h1>Errors (<%= @errors.count %>)</h1>
        <ul>
          <% @errors.each_with_index do |error, id| %>
          <li class="error" id="error-<%= id %>">
            <span class="klass"><%= error.exceptions[0].class.to_s %></span> | 
            <span class="time"><%= time_ago_or_time_stamp(error.timestamp) %></span> | 
            <span class="desc"><%= truncate(error.exceptions[0].message, 20) %></span>
          </li>
          <li class="error-detail" id="error-<%= id %>-detail">
              <ul>
                <li><strong>Message ID:</strong> <%= error.message.id %></li>
                <li><strong>Timestamp:</strong> <%= error.timestamp %></li>
              </ul>
<pre>
Queue message body:
----------------------
<%= error.message.body %>

----------------------
Exceptions:
----------------------
<% error.exceptions.each do |exception| %>
<%= exception.message %>
<%= exception.backtrace.join("\n") %><commit_msg>Updated truncation to 35 chars.<commit_after><html>
<head>
<title>QueueStick Status Page</title>
<link rel="stylesheet" href="/stylesheets/reset-fonts-grids.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/main.css" type="text/css" />

<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
  $(document).ready(function () {
    $('li.error').click(function (event) {
      $('li.error-detail').hide();
      $('li#' + this.id + '-detail').slideDown('slow');

      event.preventDefault();
    });
  });
</script>
</head>
<body>
<div id="doc2" class="yui-t7">
  <div id="hd" class="divider" role="banner">
    <h1>queue_stick</h1>
    <div class="yui-g" id="header-container">
      <div class="yui-u first">
        <em>
          Job started by <span class="network"><%= @username %></span> <%= @start_time %><br />
          Current status: <span class="network"><%= @status %></span>
        </em></li>
      </div>
      <div class="yui-u">
        <em>Running on <span class="network"><%= @hostname %></span>, port <span class="network"><%= @port %></span></em>
      </div>
    </div>
  </div>
  <div id="bd" role="main">
    <div class="yui-g padded">
      <div class="yui-u first counters">
      <% @counters.each do |counter_name, info| %>
        <h2><%= readable_name(counter_name) %></h2>
        <table id="<%= counter_name %>" class="counter">
          <thead>
            <tr>
              <th>Thread</th>
              <% info[:names].each do |name| %>
                <th><%= name %></th>
              <% end %>
            </tr>
          </thead>
          <tbody>
            <% info[:workers].each do |worker_name, counts| %>
            <tr>
              <td class="blue"><%= h(worker_name) %></td>
              <% counts.each do |count| %>
              <td><%= count %></td>
              <% end %>
            </tr>
            <% end %>
          </tbody>
          <tfoot>
            <tr>
              <th class="left"><strong>Totals</strong></td>
              <% info[:totals].each do |total| %>
              <th><%= total %></th>
              <% end %>
            </tr>
          </tfoot>
        </table>
      <% end %>
      </div>
      <div class="yui-u">
        <h1>Errors (<%= @errors.count %>)</h1>
        <ul>
          <% @errors.each_with_index do |error, id| %>
          <li class="error" id="error-<%= id %>">
            <span class="klass"><%= error.exceptions[0].class.to_s %></span> | 
            <span class="time"><%= time_ago_or_time_stamp(error.timestamp) %></span> | 
            <span class="desc"><%= truncate(error.exceptions[0].message, 35) %></span>
          </li>
          <li class="error-detail" id="error-<%= id %>-detail">
              <ul>
                <li><strong>Message ID:</strong> <%= error.message.id %></li>
                <li><strong>Timestamp:</strong> <%= error.timestamp %></li>
              </ul>
<pre>
Queue message body:
----------------------
<%= error.message.body %>

----------------------
Exceptions:
----------------------
<% error.exceptions.each do |exception| %>
<%= exception.message %>
<%= exception.backtrace.join("\n") %>
{'fraction_non_alphanumeric': 0.23460087994971715, 'fraction_numerical': 0.004085480829666876, 'mean_word_length': 1.9440333024976872, 'pattern_counts': {'":': 0, '<': 261, '<?xml version=': 0, '>': 261, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4988084', 'n_tokens_mistral': 2152, 'n_tokens_neox': 2006, 'n_words': 402}