<commit_before><?php
/*
 * HOMER Web Interface
 * App: Homer's Stats generator (User-Agents)
 *
 * Copyright (C) 2011-2012 <NAME> <<EMAIL>>
 * Copyright (C) 2011-2012 <NAME> <<EMAIL>>
 *
 * The Initial Developers of the Original Code are
 *
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
*/

//if ($_GET['hours']) {$hours = $_GET['hours'];} else {$hours= 48;}
$API = APILOC;
if ($API == 'APILOC') {
$included = 1;
include('../../configuration.php');
echo '<script type="text/javascript" src="js/highstock.js"></script>';
} else { $included = 0;}


// Server hook
//include('configuration.php');
$hours = STAT_RANGE;

?>



		<!-- <script type="text/javascript" src="../stats/js/modules/exporting.js"></script> -->
		<div id="chart5" style="float: left; min-width: 150px; width: 49%; min-height: 200px;"></div>
		<div id="chart4" style="float: right; min-width: 150px; width: 49%; min-height: 100px;"></div>
		<div id="chart6" style="float: right; min-width: 150px; width: 49%; min-height: 100px;"></div>
		<div id="control-stats">
                <select id="timer-stats"  style="width: 45; border: 0; float: right;  margin-left: 5; height: 15;" >
                        <option value="0">0</option>
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="15">15</option>
                </select>
                <button id="refresh-stats" style="width: 60; border: 0; background: #fff;  float: right; margin: 0 0 9 0;"  class="ui-button ui-widget2 ui-corner-all">refresh</button>
            	</div>

<script type="text/javascript">

$ = jQuery;

$('#refresh-stats').click(function() {

$('#live-stats').html('');

<?php

$uri = "http://".$_SERVER['SERVER_NAME'].APILOC;

$request = $uri."api.php?task=statscount&method=INVITE&measure=1&hours=".$hours;
$jsondata = file_get_contents($request);
$response = json_decode($jsondata, true);
//print_r( $response);
foreach($response as $entry){
        foreach($entry as $qdat){
	if ($qdat['avg(asr)'] >= 70) {$colASR="#8dc141"; } else if($qdat['avg(asr)'] >=50) {$colASR="#fdc141";} else {$colASR='#8d0101';}
	if ($qdat['avg(ner)'] >= 80) {$colNER="#8dc140"; } else if($qdat['avg(ner)'] >=50) {$colNER="#fdc140";} else {$colNER='#8d0100';}
  	$sipASR[] = ' '.$qdat['avg(asr)'].', ';
        $sipNER[] = ' '.$qdat['avg(ner)'].', ';
        $callTOT[] = ' '.$qdat['sum(total)'].' ';
        $callOK[] = ' '.$qdat['sum(completed)'].' ';
        $callKO[] = ' '.$qdat['sum(uncompleted)'].' ';
        }
}

$request = $uri."api.php?task=statscount&method=REGISTRATION&measure=1&hours=".$hours;
$jsondata = file_get_contents($request);
$response = json_decode($jsondata, true);
//print_r( $response);
foreach($response as $entry){
        foreach($entry as $qdat){
        $regOK[] = ' '.$qdat['sum(completed)'].' ';
        $regKO[] = ' '.$qdat['sum(uncompleted)'].' ';
        }<commit_msg>Fixed reference in highcharts QoS<commit_after><?php
/*
 * HOMER Web Interface
 * App: Homer's Stats generator (User-Agents)
 *
 * Copyright (C) 2011-2012 <NAME> <<EMAIL>>
 * Copyright (C) 2011-2012 <NAME> <<EMAIL>>
 *
 * The Initial Developers of the Original Code are
 *
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
*/

//if ($_GET['hours']) {$hours = $_GET['hours'];} else {$hours= 48;}
$API = APILOC;
if ($API == 'APILOC') {
$included = 1;
include('../../configuration.php');
echo '<script type="text/javascript" src="js/highstock.js"></script>';
} else { $included = 0;}


// Server hook
//include('configuration.php');
$hours = STAT_RANGE;

?>



		<!-- <script type="text/javascript" src="../stats/js/modules/exporting.js"></script> -->
		<div id="chart5" style="float: left; min-width: 150px; width: 49%; min-height: 200px;"></div>
		<div id="chart4" style="float: right; min-width: 150px; width: 49%; min-height: 100px;"></div>
		<div id="chart6" style="float: right; min-width: 150px; width: 49%; min-height: 100px;"></div>
		<div id="control-stats">
                <select id="timer-stats"  style="width: 45; border: 0; float: right;  margin-left: 5; height: 15;" >
                        <option value="0">0</option>
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="15">15</option>
                </select>
                <button id="refresh-stats" style="width: 60; border: 0; background: #fff;  float: right; margin: 0 0 9 0;"  class="ui-button ui-widget2 ui-corner-all">refresh</button>
            	</div>

<script type="text/javascript">

$ = jQuery;

$('#refresh-stats').click(function() {

$('#live-stats').html('');

<?php

$uri = "http://".$_SERVER['SERVER_NAME'].APILOC;

$request = $uri."api.php?task=statscount&method=INVITE&measure=1&hours=".$hours;
$jsondata = file_get_contents($request);
$response = json_decode($jsondata, true);
//print_r( $response);
foreach($response as $entry){
        foreach($entry as $qdat){
	if ($qdat['avg(asr)'] >= 70) {$colASR="#8dc141"; } else if($qdat['avg(asr)'] >=50) {$colASR="#fdc141";} else {$colASR='#8d0101';}
	if ($qdat['avg(ner)'] >= 80) {$colNER="#8dc140"; } else if($qdat['avg(ner)'] >=50) {$colNER="#fdc140";} else {$colNER='#8d0100';}
  	$sipASR[] = ' '.$qdat['avg(asr)'].', ';
        $sipNER[] = ' '.$qdat['avg(ner)'].', ';
        $callTOT[] = ' '.$qdat['sum(total)'].' ';
        $callOK[] = ' '.$qdat['sum(completed)'].' ';
        $callKO[] = ' '.$qdat['sum(uncompleted)'].' ';
        }
}

$request = $uri."api.php?task=statscount&method=REGISTER&measure=1&hours=".$hours;
$jsondata = file_get_contents($request);
$response = json_decode($jsondata, true);
//print_r( $response);
foreach($response as $entry){
        foreach($entry as $qdat){
        $regOK[] = ' '.$qdat['sum(completed)'].' ';
        $regKO[] = ' '.$qdat['sum(uncompleted)'].' ';
        }
{'fraction_non_alphanumeric': 0.20076691317447276, 'fraction_numerical': 0.032593809915091754, 'mean_word_length': 3.5844318895166354, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4992653', 'n_tokens_mistral': 2651, 'n_tokens_neox': 2419, 'n_words': 640}