<commit_before>{% extends "base.html" %}
{% block body %}

<script>
$(document).ready(function() {

  {# Initial graph generation #}
  generate_graph('hour', '%H:%M %p', '{{ username }}' );

  {# Generate user stats #}
  setTimeout(function(){
    var hashrate, seconds, mhashpersec, user_shares, est_payout,
        round_reward, shares_to_solve, percentage_value, dogerate, day_shares;

    round_reward = {{ round_reward }};
    user_shares = {{ user_shares }};

    {# Calculate est round payout  #}
    shares_to_solve = {{ g.current_difficulty }} * Math.pow(2, 16);
    percentage_value = user_shares / shares_to_solve;
    est_payout = ((percentage_value * round_reward)) * .99;

    {# Calculate mhashes/sec  #}
    seconds = 60000;
    hashrate = Math.pow(2, 16) * window.last_10min;

    {# Calculate est doge per day  #}
    day_shares = (window.last_10min * 60 * 24);
    percentage_value = day_shares / shares_to_solve;
    dogerate = ((percentage_value * round_reward)) * .99;

    mhashpersec = (hashrate / seconds) / 1000;
    setInterval(function(){
      $('.odometer.hashrate').text(Math.round(mhashpersec * 1000) / 1000);
      $('.odometer.usershares').text(Math.round(user_shares));
      $('.odometer.estpayout').text(Math.round(est_payout * 1000000) / 1000000);
      $('.odometer.dogerate').text(Math.round(dogerate * 1000) / 1000);
    },1000);

  },1000);

});
</script>

<div class="container">
  <div class="row page-header">
    <h2 style="word-wrap:break-word;">User Stats - {{ username }}</h2>
    <br>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>Round Shares:</small> <br><h4><p><span class="odometer usershares">...</span></p></h4>
        </div>
      </div>
    </div>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>Est round payout:</small> <br><h4><p><span class="odometer estpayout">...</span> &ETH;</p></h4>
        </div>
      </div>
    </div>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>10 min hashrate:</small> <br><h4><p><span class="odometer hashrate">...</span> MHashes/sec</p></h4>
        </div>
      </div>
    </div>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>Doge/day (Est. from 10 min hashrate):</small> <br><h4><p><span class="odometer dogerate">...</span> &ETH;</p></h4>
        </div>
      </div>
    </div>

  </div>
  {% if statuses %}
  <div class="row page-header">
    <h2>Worker Status</h2>
    <br>
    <div class="col-lg-12">
      {% for st in statuses %}
        <div class="col-lg-3">
          <h3>{{ st.worker }}<small style="font-weight: 300; font-size:14px;"> - <i>Updated {{ st.time | time_ago }}</i></small></h3>
            <table class="table table-striped table-hover table-responsive worker-table">
              <thead>
                <tr>
                  <th>GPU</th>
                  <th>KHash/sec</th>
                  <th>Temperature</th>
                </tr>
              </thead>
              <tbody>
              {% for gpu in st.parsed_status['gpus'] %}
                <tr>
                  <th>{{ loop.index0 }}</th>
                  <th {% if gpu.hash == 0 %}class="warning"{% endif %}>{{ (gpu.get('hash', 0)*1000)|round|int }}</th>
                  <th {% if gpu.temp > 90 %}class="danger"{% endif %}>{{ gpu.temp }}</th>
                </tr>
              {% endfor %}
              </tbody>
            </table>
            <div style="text-align:right;"><a href="/{{ username }}/{{ st.worker }}/details" style=" color:#fafafa;"><i>Details</i></a></div>
        </div>
      {% endfor %}
    </div>
  </div>
  {% endif %}

  <div class="row row-header">
    <div class="col-lg-10 col-lg-offset-1">
        <ul class="nav nav-tabs">
          <li class="active tab"><a id="hour" data-target="hour" data-format="%M:%S">Hour</a></li>
          <li class="tab"><a id="day" data-target="day" data-format="%H:%M %p">Day</a></li>
          <li class="tab"><a id="month" data-target="month" data-format="%m/%d %H:%M">Month</a></li>
        </ul><commit_msg>Changed stats to fallback on Total MH until sporadic zeros in compute mh are fixed<commit_after>{% extends "base.html" %}
{% block body %}

<script>
$(document).ready(function() {

  {# Initial graph generation #}
  generate_graph('hour', '%H:%M %p', '{{ username }}' );

  {# Generate user stats #}
  setTimeout(function(){
    var hashrate, seconds, mhashpersec, user_shares, est_payout,
        round_reward, shares_to_solve, percentage_value, dogerate, day_shares;

    round_reward = {{ round_reward }};
    user_shares = {{ user_shares }};

    {# Calculate est round payout  #}
    shares_to_solve = {{ g.current_difficulty }} * Math.pow(2, 16);
    percentage_value = user_shares / shares_to_solve;
    est_payout = ((percentage_value * round_reward)) * .99;

    {# Calculate mhashes/sec  #}
    seconds = 60000;
    hashrate = Math.pow(2, 16) * window.last_10min;

    {# Calculate est doge per day  #}
    day_shares = (window.last_10min * 60 * 24);
    percentage_value = day_shares / shares_to_solve;
    dogerate = ((percentage_value * round_reward)) * .99;

    mhashpersec = (hashrate / seconds) / 1000;
    setInterval(function(){
      $('.odometer.hashrate').text(Math.round(mhashpersec * 1000) / 1000);
      $('.odometer.usershares').text(Math.round(user_shares));
      $('.odometer.estpayout').text(Math.round(est_payout * 1000000) / 1000000);
      $('.odometer.dogerate').text(Math.round(dogerate * 1000) / 1000);
    },1000);

  },1000);

});
</script>

<div class="container">
  <div class="row page-header">
    <h2 style="word-wrap:break-word;">User Stats - {{ username }}</h2>
    <br>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>Round Shares:</small> <br><h4><p><span class="odometer usershares">...</span></p></h4>
        </div>
      </div>
    </div>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>Est round payout:</small> <br><h4><p><span class="odometer estpayout">...</span> &ETH;</p></h4>
        </div>
      </div>
    </div>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>10 min hashrate:</small> <br><h4><p><span class="odometer hashrate">...</span> MHashes/sec</p></h4>
        </div>
      </div>
    </div>
    <div class="col-lg-3">
      <div class="panel panel-default">
        <div class="panel-body text-center">
          <small>Doge/day (Est. from 10 min hashrate):</small> <br><h4><p><span class="odometer dogerate">...</span> &ETH;</p></h4>
        </div>
      </div>
    </div>

  </div>
  {% if statuses %}
  <div class="row page-header">
    <h2>Worker Status</h2>
    <br>
    <div class="col-lg-12">
      {% for st in statuses %}
        <div class="col-lg-3">
          <h3>{{ st.worker }}<small style="font-weight: 300; font-size:14px;"> - <i>Updated {{ st.time | time_ago }}</i></small></h3>
            <table class="table table-striped table-hover table-responsive worker-table">
              <thead>
                <tr>
                  <th>GPU</th>
                  <th>KHash/sec</th>
                  <th>Temperature</th>
                </tr>
              </thead>
              <tbody>
              {% for gpu in st.parsed_status['gpus'] %}
                <tr>
                  <th>{{ loop.index0 }}</th>
                  <th {% if gpu.hash == 0 %}class="warning"{% endif %}>{{ (gpu.get('Total MH', 0)*1000)|round|int }}</th>
                  <th {% if gpu.temp > 90 %}class="danger"{% endif %}>{{ gpu.temp }}</th>
                </tr>
              {% endfor %}
              </tbody>
            </table>
            <div style="text-align:right;"><a href="/{{ username }}/{{ st.worker }}/details" style=" color:#fafafa;"><i>Details</i></a></div>
        </div>
      {% endfor %}
    </div>
  </div>
  {% endif %}

  <div class="row row-header">
    <div class="col-lg-10 col-lg-offset-1">
        <ul class="nav nav-tabs">
          <li class="active tab"><a id="hour" data-target="hour" data-format="%M:%S">Hour</a></li>
          <li class="tab"><a id="day" data-target="day" data-format="%H:%M %p">Day</a></li>
          <li class="tab"><a id="month" data-target="month" data-format="%m/%d %H:%M">Month</a></li>
        </ul>
{'fraction_non_alphanumeric': 0.2011315090636185, 'fraction_numerical': 0.02470846322595543, 'mean_word_length': 2.415615141955836, 'pattern_counts': {'":': 0, '<': 257, '<?xml version=': 0, '>': 259, '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': '6928157', 'n_tokens_mistral': 3221, 'n_tokens_neox': 2944, 'n_words': 584}