<commit_before><h2>
  <%= @site.name %>
</h2>

<br>
<div class="actions">
  <%= link_to 'Delete Site', site_path(@site), class: 'button is-danger', method: :delete, :data => {:confirm => 'Are you sure?'} %>
</div>

<%= line_chart @data, @options %>

<div class="columns site-stats">
  <div class="column">
    <h1>Uptime</h1>
    <p>
      <%- if @site.checks.count > 0 %>
        <%= @site.uptime %>%
      <% else %>
        N/A
      <% end %>
    </p>
  </div>
  <div class="column">
    <h1>Average Response</h1>
    <p>
      <%- if @site.checks.average(:time) %>
        <%= (@site.checks.average(:time) * 1000).round  %>ms
      <% else %>
        N/A
      <% end %>
    </p>
  </div>
  <div class="column">
    <h1>Last Downtime</h1>
    <p>
      <%= @site.last_downtime ? time_ago_in_words(@site.last_downtime) + ' ago' : 'N/A' %>
    </p>
  </div>
  <div class="column success-in-label">
    <h1>Status</h1>
    <p class="<%= site_status_class(@site) %> site-status-<%= @site.id %>"></p>
  </div>
</div>

<hr>

<div>
  <h3 class="is-3">Latest Checks</h3>
</div>

<table class="table latest-checks">
  <thead>
    <tr>
      <th>Date/Time</th>
      <th>Response</th>
    </tr>
  </thead>
  <tbody>
    <% @site.checks.order('created_at desc').take(10).each do |check| %>
      <tr>
        <td><%= check.created_at %></td>
        <td>
          <p class="tag <%= check_status_class(check) %>">
            <%= check.status %>
          </p>
        </td><commit_msg>:bug: show Invalid Host error if no error code (#86)<commit_after><h2>
  <%= @site.name %>
</h2>

<br>
<div class="actions">
  <%= link_to 'Delete Site', site_path(@site), class: 'button is-danger', method: :delete, :data => {:confirm => 'Are you sure?'} %>
</div>

<%= line_chart @data, @options %>

<div class="columns site-stats">
  <div class="column">
    <h1>Uptime</h1>
    <p>
      <%- if @site.checks.count > 0 %>
        <%= @site.uptime %>%
      <% else %>
        N/A
      <% end %>
    </p>
  </div>
  <div class="column">
    <h1>Average Response</h1>
    <p>
      <%- if @site.checks.average(:time) %>
        <%= (@site.checks.average(:time) * 1000).round  %>ms
      <% else %>
        N/A
      <% end %>
    </p>
  </div>
  <div class="column">
    <h1>Last Downtime</h1>
    <p>
      <%= @site.last_downtime ? time_ago_in_words(@site.last_downtime) + ' ago' : 'N/A' %>
    </p>
  </div>
  <div class="column success-in-label">
    <h1>Status</h1>
    <p class="<%= site_status_class(@site) %> site-status-<%= @site.id %>"></p>
  </div>
</div>

<hr>

<div>
  <h3 class="is-3">Latest Checks</h3>
</div>

<table class="table latest-checks">
  <thead>
    <tr>
      <th>Date/Time</th>
      <th>Response</th>
    </tr>
  </thead>
  <tbody>
    <% @site.checks.order('created_at desc').take(10).each do |check| %>
      <tr>
        <td><%= check.created_at %></td>
        <td>
          <p class="tag <%= check_status_class(check) %>">
            <%= check.status ? check.status : 'Host Unreachable' %>
          </p>
        </td>
{'fraction_non_alphanumeric': 0.23261943986820427, 'fraction_numerical': 0.013838550247116969, 'mean_word_length': 2.3808463251670378, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 0, '>': 151, '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': '2241513', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1185, 'n_words': 229}