Skip to content

Commit

Permalink
show correct value for queued jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfranz committed Nov 8, 2018
1 parent e198463 commit f0f79a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lib/moab_showq_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ def active_percent
# Return the eligible jobs as percent of available jobs
#
# @return [Float] The percentage eligible as float
def eligible_percent
(eligible_jobs.to_f / available_jobs.to_f) * 100
def blocked_percent
(blocked_jobs.to_f / available_jobs.to_f) * 100
end



# Total active + eligible
#
# @return [Integer] the total number of active/eligible jobs
def available_jobs
active_jobs + eligible_jobs
active_jobs + blocked_jobs
end

# Return the processor usage as percent
Expand Down
6 changes: 3 additions & 3 deletions views/_node_status.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
</div>
<hr>
<div><h4><%= showqer.available_jobs %> Running or Queued Jobs <br><small>(and <%= showqer.blocked_jobs %> blocked jobs)</small></h4></div>
<div><h4><%= showqer.available_jobs %> Running or Queued Jobs <br><small>(and <%= showqer.eligible_jobs %> held jobs)</small></h4></div>

<div class="row">
<div class="col-sm-2 col-xs-3">Running</div>
Expand All @@ -25,7 +25,7 @@
<div class="row">
<div class="col-sm-2 col-xs-3">Queued</div>
<div class="progress progress-custom">
<div class="progress-bar progress-bar-info col-sm-10 col-xs-9" role="progressbar" style="width:<%= showqer.eligible_percent*0.89 %>%"></div>
<div><%= showqer.eligible_jobs %></div>
<div class="progress-bar progress-bar-info col-sm-10 col-xs-9" role="progressbar" style="width:<%= showqer.blocked_percent*0.89 %>%"></div>
<div><%= showqer.blocked_jobs %></div>
</div>
</div>

0 comments on commit f0f79a7

Please sign in to comment.