import React from 'react'; import { List } from 'immutable'; import { percentOf } from 'App/utils'; import { NoContent } from 'UI'; import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import SectionWrapper from './SectionWrapper'; import Barwrapper from './Barwrapper'; import Bar from './Bar'; import { useTranslation } from 'react-i18next'; function ResultTimings({ duration, timing }) { const { t } = useTranslation(); const { blocked, connect, dns, queued, receive, send, ssl, wait } = timing; const _dns = Math.max(dns, 0); const _ssl = Math.max(ssl, 0); const _connect = Math.max(connect, 0); const _blocked = Math.max(blocked, 0); const total = parseInt( _blocked + _connect + _dns + queued + receive + send + wait, ); const blockedStart = queued; const dnsStart = blockedStart + blocked; const connectStart = dnsStart + _dns; const sslStart = connectStart + _connect - _ssl; const sendStart = connectStart + _connect; const waitSrart = sendStart + send; const receiveStart = waitSrart + wait; return (
{t('No Data!')}
} // animatedIcon="no-results" show={List.isList(timing)} size="small" >
{dns >= 0 && ( )} {connect >= 0 && ( )} {ssl >= 0 && ( )}
{t('Total')}
{total} {t('ms')}
); } export default ResultTimings;