<div class="modal fade" tabindex="-1" role="dialog" id="load-test-results-modal">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">Load Test Results</h4>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= I18n.t(:close) %>"></button>
      </div>

        <div class="modal-body">
          
          <div style="text-align:right;">
            <table style="margin-bottom: 10px; ">
              <tbody>
                <tr>
                  <td><b><%= I18n.t(:load_error_rate) %></b>: </td>
                  <td>
        						<div class="input-group" style="margin-top: 0px;">
                      <div class="input-group-prepend">
                        <span class="input-group-text" style="width: 60px; text-align:right;"><%= @build.project.config.load_criteria_error_rate %></span>
                      </div>
                      <input type="text" class="form-control " style="background:white; width:75px; text-align:right; " readonly="true" value="<%= @build_load_test_error_rate %>"	/>
        						</div>                    
                  </td>
                  <td>
                    &nbsp;
                    <% is_error_rate_satisfactory  = @build_load_test_error_rate <  @build.project.config.load_criteria_error_rate  %>
                    <% if is_error_rate_satisfactory %>
                      <i class="fa fa-check fa-2x green" aria-hidden="true"></i>                  
                    <% else %>
                      <i class="fa fa-times fa-2x red" aria-hidden="true"></i>                  
                    <% end %>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
            
            <table  class="table table-striped table-condensed">
            <thead>
              <tr>
                <th width="50%">Operation</th>
                <th>Average (ms)</th>
                <th>Slowest (ms)</th>  
                <th>Pass?</th>  
              </tr>
            </thead>
            <tbody>
                          
            <% lc_idx = 0  %>
            <% @build.project.config.load_operation_criteria.each do |key, val| %>
              <tr id="load-criteria-operation-<%= lc_idx %>">
                
                <% build_operation_average_time = @build_operation_timings.select{|x| x[:operation] == key}.first[:average_time] rescue 0 %>
                <% build_operation_slowest_time = @build_operation_timings.select{|x| x[:operation] == key}.first[:slowest_time] rescue 0 %>

                <td><%= key %></td>

                <td>                  
      						<div class="input-group" style="margin-top: 0px;">
                    <div class="input-group-prepend">
                      <span class="input-group-text" style="width: 50px; text-align:right;"><%= val[:average_time] %></span>
                    </div>
                    <input type="text" class="form-control <% if build_operation_average_time > val[:average_time].to_i %>red<% else %>green<% end %>" style="background:white; width:50px; text-align:right; " readonly="true" value="<%=  build_operation_average_time%>"	/>
      						</div>                  
                </td>

                <td>                  
      						<div class="input-group" style="margin-top: 0px;">
                    <div class="input-group-prepend">
                      <span class="input-group-text" style="width: 50px; text-align:right;"><%= val[:slowest_time] %></span>
                    </div>
                    <input type="text" class="form-control <% if build_operation_slowest_time > val[:slowest_time].to_i %>red<% else %>green<% end %>" style="background:white; width:50px; text-align:right; " readonly="true" value="<%=  build_operation_slowest_time%>"	/>
      						</div>                  
                </td>

                <td style="text-align:center; padding-top: 16px;">
                  <% is_operation_pass = build_operation_average_time < val[:average_time].to_i && build_operation_slowest_time < val[:slowest_time].to_i %>
                  <% if is_operation_pass %>
                    <i class="fa fa-check fa-2x green" aria-hidden="true"></i>                  
                  <% else %>
                    <i class="fa fa-times fa-2x red" aria-hidden="true"></i>                  
                  <% end %>
                </td>
              </tr>
              <% lc_idx += 1; %>
            <% end %>
            </tbody>
          </table>

        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal" data-bs-dismiss="modal"><%= I18n.t(:close) %></button>
        </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->