openreplay/frontend/app/components/Dashboard/Widgets/TopMetrics.js
Shekar Siri 2ed5cac986
Webpack upgrade and dependency cleanup (#523)
* change(ui) - webpack update
* change(ui) - api optimize and other fixes
2022-06-03 16:47:38 +02:00

56 lines
1.7 KiB
JavaScript

import React from 'react';
import { Loader } from 'UI';
import { msToSec } from 'App/date';
import { CountBadge, Divider, widgetHOC } from './common';
@widgetHOC('topMetrics')
export default class TopMetrics extends React.PureComponent {
render() {
const { data, loading } = this.props;
return (
<div className="flex-1 no-shrink">
<Loader loading={ loading } size="small">
<div className="flex space-around align-centered">
<CountBadge
title="Avg. Response Time"
unit="s"
icon="window"
count={ msToSec(data.avgResponseTime) }
change={ data.avgPageLoadProgress }
oppositeColors
/>
<Divider />
<CountBadge
title="Request Count"
unit="ms"
icon="eye"
count={ data.requestsCount }
change={ data.avgImgLoadProgress }
oppositeColors
/>
{/* <Divider /> */}
</div>
<div className="flex space-around align-centered">
<CountBadge
title="Avg. Time till first Bite"
unit="ms"
icon="clock"
count={ data.avgTimeTilFirstBite }
change={ data.avgReqLoadProgress }
oppositeColors
/>
<Divider />
<CountBadge
title="Avg. Dom Complete Time"
unit="ms"
icon="clock"
count={ data.avgDomCompleteTime }
change={ data.avgReqLoadProgress }
oppositeColors
/>
</div>
</Loader>
</div>
);
}
}