fix(ui) - slowest domain metric data as per the api changes

This commit is contained in:
Shekar Siri 2022-07-05 10:00:49 +02:00
parent 31dcb81b0b
commit 1df6910dec
2 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ interface Props {
}
function SlowestDomains(props: Props) {
const { data, metric } = props;
const firstAvg = metric.data.chart[0] && metric.data.chart[0].errorsCount;
const firstAvg = metric.data.chart[0] && metric.data.chart[0].value;
return (
<NoContent
size="small"
@ -22,8 +22,8 @@ function SlowestDomains(props: Props) {
<Bar
key={i}
className="mb-2"
avg={numberWithCommas(Math.round(item.errorsCount))}
width={Math.round((item.errorsCount * 100) / firstAvg) - 10}
avg={numberWithCommas(Math.round(item.value))}
width={Math.round((item.value * 100) / firstAvg) - 10}
domain={item.domain}
color={Styles.colors[i]}
/>

View file

@ -6,7 +6,7 @@ const Bar = ({ className = '', width = 0, avg, domain, color }) => {
<div className={className}>
<div className="flex items-center">
<div className={stl.bar} style={{ width: `${width < 5 ? 5 : width }%`, backgroundColor: color }}></div>
<div className="ml-2">
<div className="ml-2 shrink-0">
<span className="font-medium">{avg}</span>
<span> ms</span>
</div>