public function getReports() { if ($this->issue_reports == null) { $arr = DBHelper::selectRows(TBL_REPORTS, REPORT_ISSUE . '=' . $this->issue_id, REPORT_CRASH_DATE . ' DESC', REPORT_PROJECTION, null, null, false); $this->issue_reports = array(); if (!empty($arr)) { foreach ($arr as $values) { $this->issue_reports[] = Report::createFromArray($values); } } } return $this->issue_reports; }
break; case REPORTS_PER_APPLICATION_PIE_CHART_ID: $arr = DBHelper::selectRows(TBL_REPORTS, null, null, REPORT_PACKAGE_NAME . ',COUNT(*)', REPORT_PACKAGE_NAME, null, false); if ($arr != null) { for ($i = 0; $i < sizeof($arr); ++$i) { $arr[$i][0] = ReportHelper::formatPackageName($arr[$i][0], true); } $data = ChartHelper::convertMySQLArrToPieChartJSON($arr); } else { $message = 'No data yet recorded.|'; } break; case REPORTS_EVOLUTION_LINE_CHART_ID: $projection = 'DATE(NOW()-INTERVAL ' . INC_VALUE . ' DAY) date, ' . 'DATE_FORMAT(DATE(NOW()-INTERVAL ' . INC_VALUE . ' DAY),"%m-%d") formatted_date, ' . '(SELECT COUNT(*) FROM ' . TBL_REPORTS . ' WHERE DATE(user_crash_date)=date) reports,' . '(SELECT COUNT(*) FROM ' . TBL_ISSUES . ' WHERE DATE(issue_datetime)=date) issues, ' . '(SELECT count(*)/DAYOFYEAR(DATE_FORMAT(' . REPORT_CRASH_DATE . ', "%Y-%m-%d")) FROM ' . TBL_REPORTS . ' WHERE DATE_FORMAT(' . REPORT_CRASH_DATE . ',"%Y")=\'' . date('Y') . '\') avg_per_day_current_year'; $orderby = 'inc ASC LIMIT 15'; $arr = DBHelper::selectRows(TBL_INCREMENTS, null, $orderby, $projection, null, null, true); if ($arr != null && count($arr) > 0) { $data = ChartHelper::convertMySQLArrToReportsEvolChartJSON($arr); } else { $message = 'No data yet recorded.|'; } break; default: $message = 'Unhandled chart id requested !!!'; } echo $message . '|' . $data; break; //////// CLEAR LOGS //////// CLEAR LOGS case 'clearlogs': if (strcmp($_POST['tab'], 'tabFile') == 0) {
* Copyright (c) 2013 EIRL DEVAUX J. - Medialoha. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * EIRL DEVAUX J. - Medialoha - initial API and implementation */ // count total number of issues $total = DbHelper::countRows(TBL_ISSUES, null); $nbResolved = DbHelper::countRows(TBL_ISSUES, ISSUE_STATE . '=' . IssueState::STATE_CLOSED); $nbTesting = DbHelper::countRows(TBL_ISSUES, ISSUE_STATE . '=' . IssueState::STATE_TESTING); $nbArchived = DbHelper::countRows(TBL_ISSUES, ISSUE_STATE . '=' . IssueState::STATE_ARCHIVED); // count reports not fixed $res = DBHelper::selectRows(TBL_ISSUES, ISSUE_STATE . ' NOT IN (' . ISSUE_STATE_ARCHIVED . ', ' . ISSUE_STATE_CLOSED . ', ' . ISSUE_STATE_TESTING . ')', null, ISSUE_PRIORITY . ', COUNT(' . ISSUE_ID . ') count', ISSUE_PRIORITY, null, true); $nbNotFixed = 0; $nbNotFixedCritical = 0; $nbNotFixedNormal = 0; $nbNotFixedLow = 0; if (is_array($res)) { foreach ($res as $row) { $nbNotFixed += $row->count; switch ($row->issue_priority) { case IssuePriority::CRITICAL: $nbNotFixedCritical = $row->count; break; case IssuePriority::NORMAL: $nbNotFixedNormal = $row->count; break; case IssuePriority::LOW:
define('_STACK_TRACE', 4); define('_REPORT_STATE', 5); define('_CRASH_DATE', 6); require_once '../updatehelper.php'; $mUpdateHelper = new UpdateHelper(); $mUpdateHelper->begin(); $mUpdateHelper->applySQLUpdateFile(); $mUpdateHelper->exitOnError(); $mUpdateHelper->printStartNextStepMsg('Populate increments table'); // populate table increments for ($i = 0; $i <= 180; ++$i) { $mUpdateHelper->execSQL('INSERT INTO ' . DBHelper::getTblName(TBL_INCREMENTS) . '(' . INC_VALUE . ') VALUES (' . $i . ');'); } // recreate issue keys with new algorithm $mUpdateHelper->printStartNextStepMsg('Get reports'); $reports = DBHelper::selectRows(TBL_REPORTS, null, null, 'report_id, app_version_code, app_version_name, package_name, stack_trace, report_state, user_crash_date', null, null, false); $mUpdateHelper->printStartNextStepMsg('Walk through reports array to create issues'); $issues = array(); try { foreach ($reports as $report) { $arr = explode("\n", $report[_STACK_TRACE]); $cause = $arr[0]; // create a key to identify the issue from all reports $k = DBHelper::getReportIssueKey($report); if (!array_key_exists($k, $issues)) { $mUpdateHelper->printStepMsg('Create new issue ' . $k); $issues[$k] = array('reports' => array(), 'cause' => $cause, 'state' => $report[_REPORT_STATE], 'datetime' => $report[_CRASH_DATE]); } $issues[$k]['reports'][] = $report[_REPORT_ID]; // check if state is different (if one report of the issue is archived or new then the issue is considered as archived or new) if ($issues[$k]['state'] != $report[_REPORT_STATE]) {
<?php defined('DIRECT_ACCESS_CHECK') or die('DIRECT ACCESS NOT ALLOWED'); /** * Copyright (c) 2013 EIRL DEVAUX J. - Medialoha. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * EIRL DEVAUX J. - Medialoha - initial API and implementation */ $arr = DBHelper::selectRows(TBL_ISSUES . ' LEFT JOIN ' . TBL_REPORTS . ' ON ' . REPORT_ISSUE . '=' . ISSUE_ID, null, 'distinct_count DESC, count DESC', REPORT_PHONE_MODEL . ', ' . REPORT_BRAND . ', ' . REPORT_PRODUCT . ', COUNT(DISTINCT issue_id) distinct_count, COUNT(*) count', 'CONCAT(' . REPORT_PHONE_MODEL . ', ' . REPORT_BRAND . ', ' . REPORT_PRODUCT . ')', '5', true); ?> <table class="table table-condensed most-affected" > <thead> <tr> <th>Devices</th> <th style="text-align:center;" >Issues</th> <th>Reports</th> </tr> </thead> <tbody> <?php if (is_array($arr) && sizeof($arr) > 0) { $i = 1; foreach ($arr as $row) { $class = 'most-affected-' . $i++; ?> <tr>
echo $current; ?> /day</li> <li style="padding-left:30px;" >Last year</li><li><?php echo $past; ?> /day</li> <li style="padding-left:30px;" >Today</li><li><?php echo $today; ?> </li> </ul> <ul class="inline" style="margin-top:10px;" > <?php $res = DBHelper::selectRows(TBL_REPORTS, null, null, 'count(*)', REPORT_INSTALLATION_ID, null, false); $avg = 0; $max = 0; $sum = 0; $count = sizeOf($res); if ($count > 0) { $avg = round($sum / $count, 2); foreach ($res as $row) { $count =& $row[0]; if ($count > $max) { $max = $count; } $sum += $count; } } ?>