<commit_before>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';

import CollapsableSection from '../common/CollapsableSection';
import { UsageInfo } from '../common/statelessComponents';
import Utils from '../../utils';
import BootstrapTable from 'react-bootstrap/lib/Table';
import Loader from "../common/Loader";

export const HUNDREDTHS_PLACE = 2;

const RequestUtilization = ({utilization}) => {
  const isCpuOverAllocated = utilization &&
    (utilization.maxCpuUsed > utilization.cpuReserved / utilization.numTasks);
  const isCpuThrottled = utilization && utilization.percentCpuTimeThrottled > 0;
  const attributes = utilization && (
      <div className="row">
        <div className="col-md-3">
          <UsageInfo
            title="CPU per task average"
            total={utilization.cpuReserved / utilization.numTasks}
            used={utilization.cpuUsed / utilization.numTasks}
            style={utilization.cpuUsed >= utilization.cpuReserved ? 'danger' : null}
          >
            <p>{Utils.roundTo(utilization.cpuUsed / utilization.numTasks, HUNDREDTHS_PLACE)} of {utilization.cpuReserved / utilization.numTasks} CPU reserved</p>
            <BootstrapTable responsive={false} striped={true} style={{marginTop: '10px'}}>
              <tbody>
                <tr>
                  <td>Min CPU (24 Hr Min)</td>
                  <td>{Utils.roundTo(utilization.minCpuUsed, HUNDREDTHS_PLACE)}</td>
                </tr>
                <tr>
                  <td className={isCpuOverAllocated ? 'danger' : ''}>Max CPU (24 Hr Max)</td>
                  <td className={isCpuOverAllocated ? 'danger' : ''}>{Utils.roundTo(utilization.maxCpuUsed, HUNDREDTHS_PLACE)}</td>
                </tr>
              </tbody>
            </BootstrapTable>
          </UsageInfo>
        </div>
        <div className="col-md-3">
          <UsageInfo
            title="Averge % CPU Time Throttled"
            total={100}
            used={utilization.percentCpuTimeThrottled / utilization.numTasks}
            style={isCpuThrottled ? 'danger' : null}
          >
            <BootstrapTable responsive={false} striped={true} style={{marginTop: '10px'}}>
              <tbody>
                <tr>
                  <td>Min CPU Time Throttled % (24 Hr Min)</td>
                  <td>{Utils.roundTo(utilization.minPercentCpuTimeThrottled, HUNDREDTHS_PLACE)}</td>
                </tr>
                <tr>
                  <td className={isCpuThrottled ? 'danger' : ''}>Max CPU Time Throttled % (24 Hr Max)</td>
                  <td className={isCpuThrottled ? 'danger' : ''}>{Utils.roundTo(utilization.maxPercentCpuTimeThrottled, HUNDREDTHS_PLACE)}</td>
                </tr>
              </tbody>
            </BootstrapTable>
          </UsageInfo>
        </div><commit_msg>Fix typo on request utilization component<commit_after>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';

import CollapsableSection from '../common/CollapsableSection';
import { UsageInfo } from '../common/statelessComponents';
import Utils from '../../utils';
import BootstrapTable from 'react-bootstrap/lib/Table';
import Loader from "../common/Loader";

export const HUNDREDTHS_PLACE = 2;

const RequestUtilization = ({utilization}) => {
  const isCpuOverAllocated = utilization &&
    (utilization.maxCpuUsed > utilization.cpuReserved / utilization.numTasks);
  const isCpuThrottled = utilization && utilization.percentCpuTimeThrottled > 0;
  const attributes = utilization && (
      <div className="row">
        <div className="col-md-3">
          <UsageInfo
            title="CPU per task average"
            total={utilization.cpuReserved / utilization.numTasks}
            used={utilization.cpuUsed / utilization.numTasks}
            style={utilization.cpuUsed >= utilization.cpuReserved ? 'danger' : null}
          >
            <p>{Utils.roundTo(utilization.cpuUsed / utilization.numTasks, HUNDREDTHS_PLACE)} of {utilization.cpuReserved / utilization.numTasks} CPU reserved</p>
            <BootstrapTable responsive={false} striped={true} style={{marginTop: '10px'}}>
              <tbody>
                <tr>
                  <td>Min CPU (24 Hr Min)</td>
                  <td>{Utils.roundTo(utilization.minCpuUsed, HUNDREDTHS_PLACE)}</td>
                </tr>
                <tr>
                  <td className={isCpuOverAllocated ? 'danger' : ''}>Max CPU (24 Hr Max)</td>
                  <td className={isCpuOverAllocated ? 'danger' : ''}>{Utils.roundTo(utilization.maxCpuUsed, HUNDREDTHS_PLACE)}</td>
                </tr>
              </tbody>
            </BootstrapTable>
          </UsageInfo>
        </div>
        <div className="col-md-3">
          <UsageInfo
            title="Average % CPU Time Throttled"
            total={100}
            used={utilization.percentCpuTimeThrottled / utilization.numTasks}
            style={isCpuThrottled ? 'danger' : null}
          >
            <BootstrapTable responsive={false} striped={true} style={{marginTop: '10px'}}>
              <tbody>
                <tr>
                  <td>Min CPU Time Throttled % (24 Hr Min)</td>
                  <td>{Utils.roundTo(utilization.minPercentCpuTimeThrottled, HUNDREDTHS_PLACE)}</td>
                </tr>
                <tr>
                  <td className={isCpuThrottled ? 'danger' : ''}>Max CPU Time Throttled % (24 Hr Max)</td>
                  <td className={isCpuThrottled ? 'danger' : ''}>{Utils.roundTo(utilization.maxPercentCpuTimeThrottled, HUNDREDTHS_PLACE)}</td>
                </tr>
              </tbody>
            </BootstrapTable>
          </UsageInfo>
        </div>
{'fraction_non_alphanumeric': 0.12898678414096917, 'fraction_numerical': 0.006696035242290749, 'mean_word_length': 2.2323462414578588, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2403975', 'n_tokens_mistral': 1714, 'n_tokens_neox': 1661, 'n_words': 324}