<commit_before>{% extends "outline.html" %}

{% block title %} Experiment Dashboard {% endblock %}

{% block body %}

<script>
// To pop up documnetation on the plots
popup_alert = function(text){
    document.getElementById("question-info").innerHTML = '<h4>' + text + '</h4>';
  $("#info").modal().show()
};
</script>

<!-- Question mark/info Modal -->
<div class="modal fade" id="info" tabindex="-1" role="button" aria-labelledby="" aria-hidden="true" data-keyboard="false">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-body" id="question-info" style='text-align:left;'>
      </div>
      <center>
      <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="">Dismiss</button>
      </center>
      <br>
    </div>
  </div>
</div>

<div class="container-fluid" style ='background-color: #FFFFFF; padding-bottom: 1cm; text-align: center'>
    <h2 id="header">Experiment Dashboard: {{ exp_uid }}</h2>
</div>

{% if simple_flag<2 %}
<!--################## activity #################### -->
<div class="container-fluid" style ='background-color: #FFFFFF; padding-bottom: 1cm; text-align: center'>

    <div class="col-lg-10 col-lg-offset-1" style"display: inline-block">
        <div id = "api_activity_histogram_processAnswer"></div><button type="button" class="btn btn-primary btn-xs"
                  onclick="popup_alert('This is a graph depicting the relative frequency of activity over the course of the experiment starting from the launch and ending with the current time.<br><br><b>How it is measured:</b> Events are the timestamps of when answers to queries are received by the system. <br><br><b>How to use this information:</b> Gives the practitioner a qualitative idea of how load on the system has been distributed over time.')">?</button>
    </div>
</div>

<script type="text/javascript">
    api_activity_histogram_processAnswer = function(data) {
        // data['width'] = 1000
        // data['height'] = 100
        mpld3.draw_figure("api_activity_histogram_processAnswer", data);
    }

    $.ajax({
        url: "{{ dashboard_url }}/get_stats",
        type: "POST",
        contentType: "application/json",
        data: JSON.stringify({  
            'exp_uid': "{{ exp_uid }}",
            'args':{
                'stat_id' : 'api_activity_histogram',
        		'params':{},
                'force_recompute': {{ force_recompute }}
            }
            }),
        dataType: "json"
        }).done( function(data,textStatus, jqXHR) {
        delete data['meta']
        api_activity_histogram_processAnswer(data)
        }).fail( function(error){
        console.log("Failed to get stats", error);
        });
</script>

<div class="container-fluid" style ='padding-bottom: 1cm'>   
    <div class="col-lg-10 col-lg-offset-1">
        <div class="row">
            <h2> Experiment info </h2> 
            <p> 
            <b> app_id: </b> {{ app_id }} <br>
            <b> exp_id: </b> {{ exp_uid }} <br>
            <b> git_hash: </b> <span id="git_hash"></span> <br>
            <b> Start date: </b> <span id="exp_start_data"></span> <br>
            <b> Dashboard data generated: </b> <span id="last_dashboard_update"></span> <br>
            <b> Number of participants: </b> <span id="num_participants"></span> <br>
            <b> Number of answers: </b> <span id="num_queries"></span> <br> 
            <b> Backend Exceptions: </b> <a href="{{ host_url }}/api/experiment/{{ exp_uid }}/logs/APP-EXCEPTION" target="_blank">Open in new tab</a>  <br>
            <b> Participant data: </b> <a href="{{ host_url }}/api/experiment/{{ exp_uid }}/participants?zip=True" target="_blank">Open in new tab</a>  <br>
            <b> Experiment data: </b> <a href="{{ host_url }}/api/experiment/{{ exp_uid }}" target="_blank">Open in new tab</a>  <br>
            <b> Query page: </b> <a href="{{ host_url }}/query/query_page/query_page/{{ exp_uid }}" target="_blank">Open in new tab</a>  <br>
            </p>
        </div>
    </div>
</div><commit_msg>dashboard links to same host<commit_after>{% extends "outline.html" %}

{% block title %} Experiment Dashboard {% endblock %}

{% block body %}

<script>
// To pop up documnetation on the plots
popup_alert = function(text){
    document.getElementById("question-info").innerHTML = '<h4>' + text + '</h4>';
  $("#info").modal().show()
};
</script>

<!-- Question mark/info Modal -->
<div class="modal fade" id="info" tabindex="-1" role="button" aria-labelledby="" aria-hidden="true" data-keyboard="false">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-body" id="question-info" style='text-align:left;'>
      </div>
      <center>
      <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="">Dismiss</button>
      </center>
      <br>
    </div>
  </div>
</div>

<div class="container-fluid" style ='background-color: #FFFFFF; padding-bottom: 1cm; text-align: center'>
    <h2 id="header">Experiment Dashboard: {{ exp_uid }}</h2>
</div>

{% if simple_flag<2 %}
<!--################## activity #################### -->
<div class="container-fluid" style ='background-color: #FFFFFF; padding-bottom: 1cm; text-align: center'>

    <div class="col-lg-10 col-lg-offset-1" style"display: inline-block">
        <div id = "api_activity_histogram_processAnswer"></div><button type="button" class="btn btn-primary btn-xs"
                  onclick="popup_alert('This is a graph depicting the relative frequency of activity over the course of the experiment starting from the launch and ending with the current time.<br><br><b>How it is measured:</b> Events are the timestamps of when answers to queries are received by the system. <br><br><b>How to use this information:</b> Gives the practitioner a qualitative idea of how load on the system has been distributed over time.')">?</button>
    </div>
</div>

<script type="text/javascript">
    api_activity_histogram_processAnswer = function(data) {
        // data['width'] = 1000
        // data['height'] = 100
        mpld3.draw_figure("api_activity_histogram_processAnswer", data);
    }

    $.ajax({
        url: "{{ dashboard_url }}/get_stats",
        type: "POST",
        contentType: "application/json",
        data: JSON.stringify({  
            'exp_uid': "{{ exp_uid }}",
            'args':{
                'stat_id' : 'api_activity_histogram',
        		'params':{},
                'force_recompute': {{ force_recompute }}
            }
            }),
        dataType: "json"
        }).done( function(data,textStatus, jqXHR) {
        delete data['meta']
        api_activity_histogram_processAnswer(data)
        }).fail( function(error){
        console.log("Failed to get stats", error);
        });
</script>

<div class="container-fluid" style ='padding-bottom: 1cm'>   
    <div class="col-lg-10 col-lg-offset-1">
        <div class="row">
            <h2> Experiment info </h2> 
            <p> 
            <b> app_id: </b> {{ app_id }} <br>
            <b> exp_id: </b> {{ exp_uid }} <br>
            <b> git_hash: </b> <span id="git_hash"></span> <br>
            <b> Start date: </b> <span id="exp_start_data"></span> <br>
            <b> Dashboard data generated: </b> <span id="last_dashboard_update"></span> <br>
            <b> Number of participants: </b> <span id="num_participants"></span> <br>
            <b> Number of answers: </b> <span id="num_queries"></span> <br> 
            <b> Backend Exceptions: </b> <a href="/api/experiment/{{ exp_uid }}/logs/APP-EXCEPTION" target="_blank">Open in new tab</a>  <br>
            <b> Participant data: </b> <a href="/api/experiment/{{ exp_uid }}/participants?zip=True" target="_blank">Open in new tab</a>  <br>
            <b> Experiment data: </b> <a href="/api/experiment/{{ exp_uid }}" target="_blank">Open in new tab</a>  <br>
            <b> Query page: </b> <a href="/query/query_page/query_page/{{ exp_uid }}" target="_blank">Open in new tab</a>  <br>
            </p>
        </div>
    </div>
</div>
{'fraction_non_alphanumeric': 0.18468412560506392, 'fraction_numerical': 0.006205783790492739, 'mean_word_length': 2.9364924279433318, 'pattern_counts': {'":': 0, '<': 209, '<?xml version=': 0, '>': 207, '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': '1991090', 'n_tokens_mistral': 2616, 'n_tokens_neox': 2518, 'n_words': 663}