<commit_before>#summary
  - unless @bad_chain_elements.empty?
    - @bad_chain_elements.uniq!

    #bad-chain-elements.warning
      Bad chain element(s) detected on:
      %ul
        - @bad_chain_elements.each do |miner|
          %li= miner.host + ':' + miner.port.to_s

  #total-ghs
    %h3 Local Rate
    - avg_ghs_5s = @summary[:ghs_5s].sum / @summary[:ghs_5s].count rescue 0
    - avg_ghs_avg = @summary[:ghs_avg].sum / @summary[:ghs_avg].count rescue 0

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(@summary[:ghs_5s].sum * 1e9 )
          %td.text-center= format_hashrate(avg_ghs_5s * 1e9)
        %tr
          %td Avg
          %td.text-center= format_hashrate(@summary[:ghs_avg].sum * 1e9)
          %td.text-center= format_hashrate(avg_ghs_avg * 1e9)

  #temperature
    %h3 Temperature
    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th C
          %th F
        %tr
          %td Range
          %td.text-center
            = raw(@summary[:temperature].min.round(1).to_s + ' - ' + @summary[:temperature].max.round(1).to_s + '&deg;') rescue raw('&dash;')
          %td.text-center
            - if @summary[:temperature].min && @summary[:temperature].max
              = raw(to_ferinheight(@summary[:temperature].min).to_s + ' - ' + to_ferinheight(@summary[:temperature].max).to_s + '&deg;')
            - else
              = raw('&dash;')
        %tr
          %td Avg
          %td.text-center
            = raw((@summary[:temperature].sum / @summary[:temperature].count).round(1).to_s + '&deg;') rescue raw('&dash;')
          %td.text-center
            = raw(to_ferinheight(@summary[:temperature].sum / @summary[:temperature].count).to_s + '&deg;') rescue raw('&dash;')

  .clear

  #error-rate
    - avg_error_pct = @summary[:error_rate].sum / @summary[:error_rate].count rescue 0
    - avg_error_rate = avg_error_pct / 100

    %h3 Error Rate - #{avg_error_pct.round(2)}% avg

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_5s].sum * 1e9)
          - if @summary[:ghs_5s].count > 0
            %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_5s].sum * 1e9 / @summary[:error_rate].count)
          - else
            %td.text-center= format_hashrate(0)
        %tr
          %td Avg
          %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_avg].sum * 1e9)
          - if @summary[:ghs_5s].count > 0
            %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_avg].sum * 1e9 / @summary[:error_rate].count)
          - else
            %td.text-center= format_hashrate(0)

  #pool-network
    - avg_sent = (@summary[:net_bytes_sent].sum / @summary[:net_bytes_sent].count) rescue 0
    - avg_recv = (@summary[:net_bytes_recv].sum / @summary[:net_bytes_recv].count) rescue 0
    - total = @summary[:net_bytes_sent].sum + @summary[:net_bytes_recv].sum

    %h3 Network Traffic - #{format_bytes(total)} total

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td Sent
          %td.text-center= format_bytes(@summary[:net_bytes_sent].sum)
          %td.text-center= format_bytes(avg_sent)
        %tr
          %td Recv
          %td.text-center= format_bytes(@summary[:net_bytes_recv].sum)
          %td.text-center= format_bytes(avg_recv)

  .clear

  #rejected-rate
    - avg_rejected_pct = @summary[:rejected_rate].sum / @summary[:rejected_rate].count rescue 0
    - avg_rejected_rate = avg_rejected_pct / 100
  
    %h3 Rejected Rate - #{avg_rejected_pct.round(2)}% avg

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_5s].sum * 1e9)
          - if @summary[:rejected_rate].count > 0
            %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_5s].sum * 1e9 / @summary[:rejected_rate].count)
          - else
            %td.text-center= format_hashrate(0)
        %tr
          %td Avg
          %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_avg].sum * 1e9)
          - if @summary[:rejected_rate].count > 0
            %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_avg].sum * 1e9 / @summary[:rejected_rate].count)
          - else
            %td.text-center= format_hashrate(0)

  #pool-stale
    - avg_stale_pct = @summary[:pool_stale].sum / @summary[:pool_stale].count rescue 0
    - avg_stale_rate = avg_stale_pct / 100

    %h3 Stale Rate - #{avg_stale_pct.round(2)}% avg

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_5s].sum * 1e9)
          - if @summary[:pool_stale].count > 0
            %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_5s].sum * 1e9 / @summary[:pool_stale].count)
          - else
            %td.text-center= format_hashrate(0)
            
        %tr
          %td Avg
          %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_avg].sum * 1e9)
          - if @summary[:pool_stale].count > 0
            %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_avg].sum * 1e9 / @summary[:pool_stale].count)
          - else
            %td.text-center= format_hashrate(0)

  .clear<commit_msg>hack to handle missing network data<commit_after>#summary
  - unless @bad_chain_elements.empty?
    - @bad_chain_elements.uniq!

    #bad-chain-elements.warning
      Bad chain element(s) detected on:
      %ul
        - @bad_chain_elements.each do |miner|
          %li= miner.host + ':' + miner.port.to_s

  #total-ghs
    %h3 Local Rate
    - avg_ghs_5s = @summary[:ghs_5s].sum / @summary[:ghs_5s].count rescue 0
    - avg_ghs_avg = @summary[:ghs_avg].sum / @summary[:ghs_avg].count rescue 0

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(@summary[:ghs_5s].sum * 1e9 )
          %td.text-center= format_hashrate(avg_ghs_5s * 1e9)
        %tr
          %td Avg
          %td.text-center= format_hashrate(@summary[:ghs_avg].sum * 1e9)
          %td.text-center= format_hashrate(avg_ghs_avg * 1e9)

  #temperature
    %h3 Temperature
    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th C
          %th F
        %tr
          %td Range
          %td.text-center
            = raw(@summary[:temperature].min.round(1).to_s + ' - ' + @summary[:temperature].max.round(1).to_s + '&deg;') rescue raw('&dash;')
          %td.text-center
            - if @summary[:temperature].min && @summary[:temperature].max
              = raw(to_ferinheight(@summary[:temperature].min).to_s + ' - ' + to_ferinheight(@summary[:temperature].max).to_s + '&deg;')
            - else
              = raw('&dash;')
        %tr
          %td Avg
          %td.text-center
            = raw((@summary[:temperature].sum / @summary[:temperature].count).round(1).to_s + '&deg;') rescue raw('&dash;')
          %td.text-center
            = raw(to_ferinheight(@summary[:temperature].sum / @summary[:temperature].count).to_s + '&deg;') rescue raw('&dash;')

  .clear

  #error-rate
    - avg_error_pct = @summary[:error_rate].sum / @summary[:error_rate].count rescue 0
    - avg_error_rate = avg_error_pct / 100

    %h3 Error Rate - #{avg_error_pct.round(2)}% avg

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_5s].sum * 1e9)
          - if @summary[:ghs_5s].count > 0
            %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_5s].sum * 1e9 / @summary[:error_rate].count)
          - else
            %td.text-center= format_hashrate(0)
        %tr
          %td Avg
          %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_avg].sum * 1e9)
          - if @summary[:ghs_5s].count > 0
            %td.text-center= format_hashrate(avg_error_rate * @summary[:ghs_avg].sum * 1e9 / @summary[:error_rate].count)
          - else
            %td.text-center= format_hashrate(0)

  #pool-network
    - avg_sent = (@summary[:net_bytes_sent].compact.sum / @summary[:net_bytes_sent].compact.count) rescue 0
    - avg_recv = (@summary[:net_bytes_recv].compact.sum / @summary[:net_bytes_recv].compact.count) rescue 0
    - total = @summary[:net_bytes_sent].compact.sum + @summary[:net_bytes_recv].compact.sum

    %h3 Network Traffic - #{format_bytes(total)} total

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td Sent
          %td.text-center= format_bytes(@summary[:net_bytes_sent].compact.sum)
          %td.text-center= format_bytes(avg_sent)
        %tr
          %td Recv
          %td.text-center= format_bytes(@summary[:net_bytes_recv].compact.sum)
          %td.text-center= format_bytes(avg_recv)

  .clear

  #rejected-rate
    - avg_rejected_pct = @summary[:rejected_rate].sum / @summary[:rejected_rate].count rescue 0
    - avg_rejected_rate = avg_rejected_pct / 100
  
    %h3 Rejected Rate - #{avg_rejected_pct.round(2)}% avg

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_5s].sum * 1e9)
          - if @summary[:rejected_rate].count > 0
            %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_5s].sum * 1e9 / @summary[:rejected_rate].count)
          - else
            %td.text-center= format_hashrate(0)
        %tr
          %td Avg
          %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_avg].sum * 1e9)
          - if @summary[:rejected_rate].count > 0
            %td.text-center= format_hashrate(avg_rejected_rate * @summary[:ghs_avg].sum * 1e9 / @summary[:rejected_rate].count)
          - else
            %td.text-center= format_hashrate(0)

  #pool-stale
    - avg_stale_pct = @summary[:pool_stale].sum / @summary[:pool_stale].count rescue 0
    - avg_stale_rate = avg_stale_pct / 100

    %h3 Stale Rate - #{avg_stale_pct.round(2)}% avg

    %table(cellpadding="0" cellspacing="0")
      %tbody
        %thead
          %th
          %th Global
          %th Avg
        %tr
          %td 5s
          %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_5s].sum * 1e9)
          - if @summary[:pool_stale].count > 0
            %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_5s].sum * 1e9 / @summary[:pool_stale].count)
          - else
            %td.text-center= format_hashrate(0)
            
        %tr
          %td Avg
          %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_avg].sum * 1e9)
          - if @summary[:pool_stale].count > 0
            %td.text-center= format_hashrate(avg_stale_rate * @summary[:ghs_avg].sum * 1e9 / @summary[:pool_stale].count)
          - else
            %td.text-center= format_hashrate(0)

  .clear
{'fraction_non_alphanumeric': 0.13947950331689063, 'fraction_numerical': 0.017179792481714577, 'mean_word_length': 2.191910966340934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1992133', 'n_tokens_mistral': 4257, 'n_tokens_neox': 4076, 'n_words': 654}