From be7e1737caae715fd38b2357680d2119c6a848ed Mon Sep 17 00:00:00 2001 From: bartoval Date: Sun, 15 Dec 2024 18:12:46 +0100 Subject: [PATCH] refactor(Metrics): :recycle: Polish metric tables --- __tests__/__snapshots__/Metric.spec.tsx.snap | 6 +- .../Metrics/components/LatencyCharts.tsx | 77 +++++++++++-------- .../Metrics/components/RequestCharts.tsx | 4 +- .../Metrics/components/ResponseCharts.tsx | 2 +- .../Metrics/components/TcpConnection.tsx | 2 +- .../Metrics/components/TrafficCharts.tsx | 4 +- 6 files changed, 53 insertions(+), 42 deletions(-) diff --git a/__tests__/__snapshots__/Metric.spec.tsx.snap b/__tests__/__snapshots__/Metric.spec.tsx.snap index d9d5b0fd..0e4bf933 100644 --- a/__tests__/__snapshots__/Metric.spec.tsx.snap +++ b/__tests__/__snapshots__/Metric.spec.tsx.snap @@ -380,7 +380,7 @@ exports[`Metrics Component renders correctly 1`] = ` >
= memo(({ latenciesData, bucketsData, summary }) => ( - - + + {Labels.PercentileOverTime} label)} data={latenciesData.map(({ data }) => data)} /> - + - - label)} - data={bucketsData.map(({ data }) => data)} - /> - +
+ + + + + {Labels.Buckets} + label)} + data={bucketsData.map(({ data }) => data)} + /> + + + - - - - - - - - - + +
ThresholdBelowAbove
+ + + + + + + - - {summary.map((row, index) => ( - - - - - - ))} - -
ThresholdBelowAbove
- {row.bound} - {`${formatNumber(row.lessThanCount)} (${row.lessThanPerc}%)`}{`${formatNumber(row.greaterThanCount)}`}
-
-
+ + {summary.map((row, index) => ( + + + {row.bound} + + {`${formatNumber(row.lessThanCount)} (${row.lessThanPerc}%)`} + {`${formatNumber(row.greaterThanCount)}`} + + ))} + + + + + + )); export default LatencyCharts; diff --git a/src/pages/shared/Metrics/components/RequestCharts.tsx b/src/pages/shared/Metrics/components/RequestCharts.tsx index 3a672edd..ec2ff0fc 100644 --- a/src/pages/shared/Metrics/components/RequestCharts.tsx +++ b/src/pages/shared/Metrics/components/RequestCharts.tsx @@ -13,7 +13,7 @@ const RequestCharts: FC<{ requestRateData: RequestMetrics[]; requestPerf: { avg: number; max: number; current: number; label: string }[] | undefined; }> = memo(({ requestRateData, requestPerf }) => ( - + data)} @@ -25,7 +25,7 @@ const RequestCharts: FC<{ - +
diff --git a/src/pages/shared/Metrics/components/ResponseCharts.tsx b/src/pages/shared/Metrics/components/ResponseCharts.tsx index fa329fb7..25998c12 100644 --- a/src/pages/shared/Metrics/components/ResponseCharts.tsx +++ b/src/pages/shared/Metrics/components/ResponseCharts.tsx @@ -57,7 +57,7 @@ const ResponseCharts: FC<{ responseRateData: ResponseMetrics | null; responseDat {/* Errors distribution */} = function ({ {!isLoading && connections && ( <> {isRefetching && } - + {connections.liveConnectionsSerie && ( diff --git a/src/pages/shared/Metrics/components/TrafficCharts.tsx b/src/pages/shared/Metrics/components/TrafficCharts.tsx index cb1ec144..d22d0c52 100644 --- a/src/pages/shared/Metrics/components/TrafficCharts.tsx +++ b/src/pages/shared/Metrics/components/TrafficCharts.tsx @@ -14,7 +14,7 @@ import { MetricsController } from '../services'; const TrafficCharts: FC<{ byteRateData: ByteRateMetrics; colorScale?: string[] }> = memo( ({ byteRateData, colorScale }) => ( - + + +
{Labels.Method}