Skip to content

Commit

Permalink
Add rate setting for major outage
Browse files Browse the repository at this point in the history
Major outage criteria depends on required service level.
Default value keeps 50% because it had been fixed to 50%.
  • Loading branch information
shuichiro-makigaki committed May 8, 2018
1 parent db8874c commit f07c071
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Integrations/Core/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public function getStatus()

$totalComponents = Component::enabled()->authenticated($includePrivate)->count();
$majorOutages = Component::enabled()->authenticated($includePrivate)->status(4)->count();
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;
$majorOutageRate = (int) $this->config->get('setting.major_outage_rate', '50');
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents)*100 >= $majorOutageRate : false;

// Default data
$status = [
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'time_before_refresh' => 'Status page refresh rate (in seconds)',
'major_outage_rate' => 'Major outage threshold (in %)',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide",
'subscribers' => 'Allow people to signup to email notifications?',
Expand Down
8 changes: 8 additions & 0 deletions resources/views/dashboard/settings/app-setup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label>{{ trans('forms.settings.app-setup.major_outage_rate') }}</label>
<input type="number" name="major_outage_rate" class="form-control" value="{{ Config::get('setting.major_outage_rate', 50) }}" placeholder="{{ trans('forms.settings.app-setup.major_outage_rate') }}">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="checkbox">
Expand Down

0 comments on commit f07c071

Please sign in to comment.