コード例 #1
0
ファイル: boxplot.js.php プロジェクト: redsn0w422/DarshanVis
<?php

$data = Jobs::execSQLQuery($chart["series"][0]["query"]);
//print_r($data);
$cats_str = "";
$series_str = "";
foreach ($data as $d) {
    $cats_str .= '\'' . $d[$chart["xAxis"]["attribute"]] . '\'' . ',';
    $series_str .= '[' . $d[$chart["series"][0]["min"]] . ',' . $d[$chart["series"][0]["q1"]] * 2 . ',' . $d[$chart["series"][0]["median"]] . ',' . $d[$chart["series"][0]["q3"]] * 0.5 . ',' . $d[$chart["series"][0]["max"]] . '],';
}
$cats_str = rtrim($cats_str, ",");
$series_str = rtrim($series_str, ",");
//echo $series_str;
?>
<script type="text/javascript">
    $(function() {
        $('#chart-container').highcharts({
            chart: {
                type: 'boxplot'
            },
            title: {
                text: '<?php 
echo $chart["title"];
?>
'
            },
            legend: {
                enabled: false
            },
            xAxis: {
                categories: [<?php 
コード例 #2
0
<?php

include_once 'utils2.php';
$category_list = Jobs::execSQLQuery($chart["query"]["category"]);
//var_dump($category_list);
//$merged_query = $chart["query"]["merged_query"];
$merged_query_1 = $chart["query"]["merged_query_1"];
//$orderby = "sum_bytes";
//$data = Jobs::execSQLQuery($merged_query);
$result = Jobs::execSQLQuery($merged_query_1);
$throughput = Jobs::execSQLQuery($chart["query"]["throughput"]);
$category_1 = array();
$series = array();
$max = "";
$median = "";
//var_dump($throughput);
foreach ($throughput as $app) {
    $max .= $app["max"] . ",";
    $median .= $app["median"] . ",";
}
$max = rtrim($max, ",");
$median = rtrim($median, ",");
//var_dump($max);
foreach ($category_list as $app) {
    $category_1[] = $app['appname'];
}
//initialize strings for the attribute series
for ($i = 1; $i <= 6; $i++) {
    // var_dump($chart["series"][0]["attr" . $i]);
    if (!isset($series[$i])) {
        $series[$i] = "";
コード例 #3
0
ファイル: topk.tb.php プロジェクト: huongluu/DarshanVis
<?php

$data = Jobs::execSQLQuery($chart["table"]["query"]);
//print_r($data);
//echo $series_str;
?>

<div class="container">

    <table id="dv_table" class="table table-striped table-bordered text-right" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th></th>
                <th>Name</th>
                <th>Number of jobs</th>
                <th>Total Runtime (hours)</th>
                <th>Total I/O Time (hours)</th>
                <th>Total Amount of Data Read/Written</th>
                <th>Average Percentage of Runtime in I/O</th>
                <th>Median I/O Thruput (GB/s)</th>
            </tr>
        </thead>
        <tbody>
            <?php 
$index = 1;
foreach ($data as $d) {
    echo "<tr>";
    echo "<td>" . $index . "</td>";
    echo "<td>" . $d['appname'] . "</td>";
    echo "<td>" . round($d['numjobs']) . "</td>";
    echo "<td>" . round($d['total_runtime_h']) . "</td>";
コード例 #4
0
<?php

$X_AXIS = "total_bytes";
$Y_AXIS = "nprocs";
$data = Jobs::execSQLQuery($chart["series"][0]["query"]);
$query = "select uid, appname, start_time, total_bytes, nprocs, agg_perf_MB from jobs_info where total_bytes>0 and nprocs>0 and agg_perf_MB>0";
$all_data = array();
$app_names = "";
foreach ($data as $d) {
    $series_str = "";
    $series1_str = "";
    $series2_str = "";
    $req = Jobs::execSQLQuery($query . " and appname='" . $d['appname'] . "';");
    // print_r($req);
    foreach ($req as $r) {
        $series_str .= '[' . $r[$X_AXIS] . ',' . $r[$Y_AXIS] . '],';
        $series1_str .= $r[$X_AXIS] . ',';
        $series2_str .= $r[$Y_AXIS] . ',';
        // $ret = array();
        //
        // foreach($x_options as $str)
        // {
        //   $series = "";
        //   foreach ($data as $d)
        //   {
        //     $series .= $d[$str] . ',';
        //     // $series = rtrim($series, ",");
        //   }
        //   $ret[$str] = $series;
        // }
    }
コード例 #5
0
}
if (isset($_POST["sort-level3"])) {
    $sortlevel3 = $_POST["sort-level3"];
    $mode3 = "desc";
    if (isset($_POST["mode-level3"])) {
        $mode1 = $_POST["mode-level3"];
    }
    $q = Jobs::addSortingLevel($q, $sortlevel3, $mode3);
}
if (isset($_POST["application"]) && strlen($_POST["application"]) > 0) {
    $q = Jobs::filter($q, "appname", $_POST["application"]);
}
if (isset($_POST["user"]) && strlen($_POST["user"]) > 0) {
    $q = Jobs::filter($q, "uid", $_POST["user"]);
}
$data = Jobs::execSQLQuery($q);
//print_r($data);
//$cats_str = "";
$series_str = array();
if (sizeof($data) > 0) {
    $attr_count = 7;
    foreach ($data as $d) {
        for ($i = 1; $i <= $attr_count; $i++) {
            if (!isset($series_str[$chart["series"][0]["attr" . $i]])) {
                $series_str[$chart["series"][0]["attr" . $i]] = "";
            }
            $num = $d[$chart["series"][0]["attr" . $i]];
            if (strpos($num, ".") == true) {
                $num = round($num, 1);
            }
            $series_str[$chart["series"][0]["attr" . $i]] .= $num . ',';
コード例 #6
0
 public function actionFilter()
 {
     if (!YII_DEBUG && !Yii::app()->request->isAjaxRequest) {
         throw new CHttpException('403', 'Forbidden access.');
     }
     $result = array();
     $url = $_POST["url"];
     $pos = strrpos($url, "?");
     $chartId = substr($url, $pos + 3);
     //        echo $chartId;
     $chart = getChartInfo($chartId);
     $result["msg"] = "successful";
     $result["chart"] = $chart;
     $q = $chart["query"];
     if (isset($_POST["start_date"]) && strlen($_POST["start_date"]) > 0) {
         $q = Jobs::filter($q, "start_time", $_POST["start_date"], ">");
     }
     if (isset($_POST["end_date"]) && strlen($_POST["end_date"]) > 0) {
         $q = Jobs::filter($q, "end_time", $_POST["end_date"], "<");
     }
     if (isset($_POST["application"]) && strlen($_POST["application"]) > 0) {
         $q = Jobs::filter($q, "appname", $_POST["application"]);
     }
     if (isset($_POST["numapp"]) && strlen($_POST["numapp"]) > 0) {
         $q = Jobs::Limit($q, $_POST["numapp"]);
     }
     if (!isset($q["order"])) {
         $orderby = "start_time";
     } else {
         $orderby = $q["order"];
     }
     if (isset($_POST["sort_level1"]) && strlen($_POST["sort_level1"]) > 0) {
         $orderby = $_POST["sort_level1"];
     }
     $mode1 = "desc";
     if (isset($_POST["mode_level1"])) {
         $mode1 = $_POST["mode_level1"];
     }
     $q = Jobs::OrderBy($q, $orderby, $mode1);
     $q = Jobs::Limit($q, 15000);
     if (isset($_POST["sort_level2"]) && strlen($_POST["sort_level2"]) > 0) {
         $sortlevel2 = $_POST["sort_level2"];
         $mode2 = "desc";
         if (isset($_POST["mode_level2"])) {
             $mode1 = $_POST["mode_level2"];
         }
         $q = Jobs::addSortingLevel($q, $sortlevel2, $mode2);
     }
     if (isset($_POST["sort_level3"]) && strlen($_POST["sort_level3"]) > 0) {
         $sortlevel3 = $_POST["sort_level3"];
         $mode3 = "desc";
         if (isset($_POST["mode_level3"])) {
             $mode1 = $_POST["mode_level3"];
         }
         $q = Jobs::addSortingLevel($q, $sortlevel3, $mode3);
     }
     if (isset($_POST["user"]) && strlen($_POST["user"]) > 0) {
         $q = Jobs::filter($q, "uid", $_POST["user"]);
     }
     //var_dump($q) ;
     $data = Jobs::execSQLQuery($q);
     //print_r($data);
     $preprocess = $chart["preprocess"];
     $queryResult = $preprocess($chart, $data);
     $result["queryresult"] = $queryResult;
     $result["query"] = $q;
     //        $result = array_merge($result, $result2);
     //echo $series_str;
     //        print_r($_GET);
     //        if (empty($_GET['data'])) {
     //            throw new CHttpException('404', 'Missing "data" GET parameter.');
     //        }
     //        $term = $_GET['term'];
     //        $filters = empty($_GET['exclude']) ? null : (int) $_GET['exclude']);
     //        echo json_encode(User::completeTerm($term, $exclude));
     header('Content-Type: application/json; charset="UTF-8"');
     echo json_encode($result);
     Yii::app()->end();
 }