Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding startup crash icon fixes bug 732067 #440

Merged
1 commit merged into from
Mar 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions webapp-php/application/config/topcrashers.php-dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@
*/
$config['numberofsignatures'] = 20;

/**
* The category value against which to check for startup crashes
*/
$config['total_uptime_condition'] = "< 1 min";

/**
* The percentage of crashes that needs to be surpased to be marked
* a startup crasher.
*/
$config['percentage_uptime_condition'] = "50";
?>
4 changes: 3 additions & 1 deletion webapp-php/application/controllers/topcrasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ public function byversion($product=null, $version=null, $duration=null, $crash_t
$top_crasher->{'display_percent'} = number_format($top_crasher->percentOfTotal * 100, 2) . "%";
$top_crasher->{'display_previous_percent'} = number_format($top_crasher->previousPercentOfTotal * 100, 2) . "%";
$top_crasher->{'display_change_percent'} = number_format($top_crasher->changeInPercentOfTotal * 100, 2) . "%";

$top_crasher->{'startup_crash'} = $this->topcrashers_model->isStartupCrasher($top_crasher->signature, $resp->start_date, $params->end_date);

array_push($signatures, $top_crasher->signature);

$top_crasher->{'correlation_os'} = Correlation::correlationOsName($top_crasher->win_count, $top_crasher->mac_count, $top_crasher->linux_count);
Expand Down Expand Up @@ -409,6 +410,7 @@ public function byos($product=null, $version=null, $os=null, $duration=null, $cr
$top_crasher->{'display_percent'} = number_format($top_crasher->percentOfTotal * 100, 2) . "%";
$top_crasher->{'display_previous_percent'} = number_format($top_crasher->previousPercentOfTotal * 100, 2) . "%";
$top_crasher->{'display_change_percent'} = number_format($top_crasher->changeInPercentOfTotal * 100, 2) . "%";
$top_crasher->{'startup_crash'} = $this->topcrashers_model->isStartupCrasher($top_crasher->signature, $resp->start_date, $params->end_date);

array_push($signatures, $top_crasher->signature);
$top_crasher->{'correlation_os'} = Correlation::correlationOsName($top_crasher->win_count, $top_crasher->mac_count, $top_crasher->linux_count);
Expand Down
23 changes: 23 additions & 0 deletions webapp-php/application/models/topcrashers.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ public function buildURI($params, $apiEntry)

return implode($separator, $apiData);
}

/**
* Determined whether the current signature can be labeled as a
* startup crasher based on the total percentage for uptime < 1min
*
* @param string the signature
* @param date the start date
* @param date the end date
* @return bool
*/
public function isStartupCrasher($signature, $start_date, $end_date) {
$summary_model = new Signature_Summary_Model();
$uptime = $summary_model->getSummary('uptime', $signature, $start_date, $end_date);
foreach($uptime as $up) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to use the existing Signature_Summary_Model object to reduce queries and get this information?

$total_uptime = $up->category;
$percentage = round($up->percentage * 100);

if(($total_uptime === Kohana::config('topcrashers.total_uptime_condition')) && ($percentage > Kohana::config('topcrashers.percentage_uptime_condition'))) {
return TRUE;
}
}
return FALSE;
}

/**
* Fetch the top crashers data via a web service call.
Expand Down
3 changes: 3 additions & 0 deletions webapp-php/application/views/common/tc_crash_types.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<?php if(property_exists($crasher, 'startup_crash') && $crasher->startup_crash) { ?>
<img src="<?= url::site('/img/icons/rocket_fly.png')?>" width="16" height="16" alt="Startup Crash" title="Startup Crash" class="startup" />
<?php } ?>
<?php
$linked = false;
if (isset($crasher->{'link'}) && !empty($crasher->{'link'})) {
Expand Down
3 changes: 3 additions & 0 deletions webapp-php/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,9 @@ table.tablesorter tbody tr.odd {
.hide {
display: none;
}
.startup {
margin-right: 1px;
}
/* standard table styles for data tables */
table.data-table {
width: 100%;
Expand Down
Binary file added webapp-php/img/icons/rocket_fly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.