-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added metrics information to session card
- Loading branch information
Showing
4 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
dev/metrics/views/batch_connect/sessions/card/_card_body.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="card-body"> | ||
<div> | ||
<div class="float-end"><%= cancel_or_delete(session) %></div> | ||
<%= render_card_partial('host', session) %> | ||
<%= render_card_partial('created', session) %> | ||
<%= render_card_partial('session_time', session) %> | ||
<%= render_card_partial('id', session) %> | ||
<%= render_card_partial('support_ticket', session) if Configuration.support_ticket_enabled? %> | ||
<%= render_card_partial('display_choices', session) %> | ||
<%= render_card_partial('session_job_metrics', session) if session.completed?%> | ||
<%= render_connection(session) %> | ||
</div> | ||
</div> |
117 changes: 117 additions & 0 deletions
117
dev/metrics/views/batch_connect/sessions/card/_session_job_metrics.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<% | ||
|
||
metrics_service = SlurmMetrics::MetricsService.new | ||
job_metrics = metrics_service.read_job_metrics(session) | ||
metrics_helper = SlurmMetrics::MetricsHelper.new | ||
metric_details_id = "#{session.id}_metric" | ||
%> | ||
|
||
<style> | ||
|
||
table.metrics th { | ||
font-size: 0.9rem; | ||
} | ||
table.metrics td { | ||
font-size: 0.8rem; | ||
} | ||
|
||
.job-metrics i.app-icon { | ||
width: 0.8rem; | ||
height: 0.8rem; | ||
font-size: 0.8rem; | ||
vertical-align: 1px; | ||
color: #6c757d; | ||
} | ||
|
||
div.job-metric-details { | ||
overflow: hidden; | ||
} | ||
|
||
div.job-metric-details [title]{ | ||
cursor: default; | ||
} | ||
|
||
div.job-metric-details table { | ||
margin-top: 0.5rem; | ||
} | ||
|
||
div.job-metric-details .text-dark { | ||
--bs-text-opacity: 0.8; | ||
} | ||
|
||
p.job-metrics-description { | ||
cursor: pointer; | ||
margin: 0; | ||
} | ||
|
||
p[aria-expanded=true] .closed { | ||
display: none; | ||
} | ||
|
||
p[aria-expanded=false] .open { | ||
display: none; | ||
} | ||
|
||
</style> | ||
<hr> | ||
<div class="job-metrics"> | ||
<p class="job-metrics-description" data-toggle="collapse" data-target="#<%= metric_details_id %>" data-bs-toggle="collapse" data-bs-target="#<%= metric_details_id %>" aria-expanded="false"> | ||
<i class="fa fa-plus fa-fw app-icon closed" aria-hidden="true"></i> | ||
<i class="fa fa-minus fa-fw app-icon open" aria-hidden="true"></i> | ||
<strong>Job Efficiency: </strong> | ||
<span class="badge bg-light text-dark" title="">CPU <%= job_metrics.ave_cpu_eff.ceil(1) %>%</span> | ||
<span class="card-text"> | </span> | ||
<span class="badge bg-light text-dark" title="">Memory <%= job_metrics.ave_mem_eff.ceil(1) %>%</span> | ||
<span class="card-text"> | </span> | ||
<span class="badge bg-light text-dark" title="">Time <%= job_metrics.ave_time_eff.ceil(1) %>%</span> | ||
</p> | ||
|
||
<div class="job-metric-details"> | ||
<div id="<%= metric_details_id %>" class="collapse"> | ||
|
||
<table class="table table-sm table-striped table-condensed metrics"> | ||
<thead> | ||
<tr> | ||
<th class="fs-5">Metrics</th> | ||
<th title="">Efficiency</th> | ||
<th title="">Allocated</th> | ||
<th title="">Used</th> | ||
<th title="">Other</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>CPU</td> | ||
<td><%= "#{job_metrics.ave_cpu_eff.ceil(2)}%" %></td> | ||
<td><%= "#{job_metrics.ave_cpu_req.ceil(2)} CPU Hrs" %></td> | ||
<td><%= "#{job_metrics.ave_cpu_use.ceil(2)} CPU Hrs" %></td> | ||
<td>Walltime <%= "#{job_metrics.tot_cpu_walltime.ceil(2)} CPU Hrs" %></td> | ||
</tr> | ||
<tr> | ||
<td>Memory</td> | ||
<td><%= "#{job_metrics.ave_mem_eff.ceil(2)}%" %></td> | ||
<td><%= "#{job_metrics.ave_mem_req.ceil(2)}G" %></td> | ||
<td><%= "#{job_metrics.ave_mem_use.ceil(2)}G" %></td> | ||
<td>N/A</td> | ||
</tr> | ||
<tr> | ||
<td>Time</td> | ||
<td><%= "#{job_metrics.ave_time_eff.ceil(2)}%" %></td> | ||
<td><%= metrics_helper.format_duration(job_metrics.ave_time_req) %></td> | ||
<td><%= metrics_helper.format_duration(job_metrics.ave_time_use) %></td> | ||
<td>Waiting Time <%= metrics_helper.format_duration(job_metrics.ave_wait_time) %></td> | ||
</tr> | ||
<tr> | ||
<td>GPU</td> | ||
<td>N/A</td> | ||
<td><%= "#{job_metrics.ave_gpu_req.ceil(2)} GPU Hrs" %></td> | ||
<td>N/A</td> | ||
<td>Walltime <%= "#{job_metrics.tot_gpu_hours.ceil(2)} GPU Hrs" %></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> |