From 05ad1f9426c6ab0de097ee54fea6556bd3a6692d Mon Sep 17 00:00:00 2001 From: nofar9792 Date: Thu, 24 Feb 2022 16:11:57 +0200 Subject: [PATCH 1/3] Fix Signed-off-by: nofar9792 --- .../operationDetailsTable/__snapshots__/index.test.js.snap | 2 +- .../Monitor/ServicesView/operationDetailsTable/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap index 1222d27460..ba0d9cc5fc 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/__snapshots__/index.test.js.snap @@ -957,7 +957,7 @@ exports[` render some values in the table 1`] = `
- 1% + 100%
diff --git a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.tsx b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.tsx index 002e6fd15c..9ca0fa42bd 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.tsx +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.tsx @@ -116,7 +116,7 @@ export class OperationTableDetails extends React.PureComponent { />
{typeof value === 'number' && row.dataPoints.service_operation_error_rate.length > 0 - ? `${value}%` + ? `${value * 100}%` : ''}
From fb81204274630e9a6869608c807f4085bcf345bf Mon Sep 17 00:00:00 2001 From: nofar9792 Date: Mon, 28 Feb 2022 17:05:42 +0200 Subject: [PATCH 2/3] Convert to 100 Signed-off-by: nofar9792 --- .../__snapshots__/index.test.js.snap | 4 +-- .../components/Monitor/ServicesView/index.tsx | 29 +++++++++++++++++-- .../__snapshots__/index.test.js.snap | 4 +-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/packages/jaeger-ui/src/components/Monitor/ServicesView/__snapshots__/index.test.js.snap b/packages/jaeger-ui/src/components/Monitor/ServicesView/__snapshots__/index.test.js.snap index 93ffb71867..6e2d1428fb 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/__snapshots__/index.test.js.snap +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/__snapshots__/index.test.js.snap @@ -196,11 +196,11 @@ exports[` ATM snapshot test 1`] = ` "metricPoints": Array [ Object { "x": 1631274747520, - "y": 1, + "y": 100, }, Object { "x": 1631274807520, - "y": 1, + "y": 100, }, ], "quantile": 0.95, diff --git a/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx b/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx index ee87b2b86c..df9ed586eb 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx @@ -30,7 +30,13 @@ import OperationTableDetails from './operationDetailsTable'; import LoadingIndicator from '../../common/LoadingIndicator'; import MonitorATMEmptyState from '../EmptyState'; import { ReduxState } from '../../../types'; -import { MetricsAPIQueryParams, MetricsReduxState, ServiceOpsMetrics } from '../../../types/metrics'; +import { + MetricsAPIQueryParams, + MetricsReduxState, + Points, + ServiceMetricsObject, + ServiceOpsMetrics, +} from '../../../types/metrics'; import prefixUrl from '../../../utils/prefix-url'; import './index.css'; @@ -86,6 +92,24 @@ export const getLoopbackInterval = (interval: number) => { return timeFrameObj.label.toLowerCase(); }; +const convertServiceErrorRateToPercentages = (serviceErrorRate: null | ServiceMetricsObject) => { + if (!serviceErrorRate) return null; + // const cloneServiceErrorRate: ServiceMetricsObject = JSON.parse(JSON.stringify(serviceErrorRate)); + // cloneServiceErrorRate.metricPoints.forEach((metricPoint: Points) => { + // metricPoint.y! *= 100; + // }); + + const wew = serviceErrorRate.metricPoints.map((metricPoint: Points) => { + // metricPoint.y! *= 100; + + return { ...metricPoint, y: metricPoint.y! * 100 }; + }); + + // cloneServiceErrorRate.metricPoints = wew; + + return { ...serviceErrorRate, metricPoints: wew }; +}; + // export for tests export class MonitorATMServicesViewImpl extends React.PureComponent { graphDivWrapper: React.RefObject; @@ -175,6 +199,7 @@ export class MonitorATMServicesViewImpl extends React.PureComponent; @@ -265,7 +290,7 @@ export class MonitorATMServicesViewImpl extends React.PureComponent render greater than 0.1 requests value in the t
- 1% + 100%
@@ -1647,7 +1647,7 @@ exports[` render number with more than 2 decimal places v
- 1% + 100%
From f0d0bc8239fa7a154f0cafb28892d620d7fb26e4 Mon Sep 17 00:00:00 2001 From: nofar9792 Date: Mon, 28 Feb 2022 17:07:51 +0200 Subject: [PATCH 3/3] Without comments Signed-off-by: nofar9792 --- .../src/components/Monitor/ServicesView/index.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx b/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx index df9ed586eb..210a51803e 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/index.tsx @@ -94,19 +94,11 @@ export const getLoopbackInterval = (interval: number) => { const convertServiceErrorRateToPercentages = (serviceErrorRate: null | ServiceMetricsObject) => { if (!serviceErrorRate) return null; - // const cloneServiceErrorRate: ServiceMetricsObject = JSON.parse(JSON.stringify(serviceErrorRate)); - // cloneServiceErrorRate.metricPoints.forEach((metricPoint: Points) => { - // metricPoint.y! *= 100; - // }); const wew = serviceErrorRate.metricPoints.map((metricPoint: Points) => { - // metricPoint.y! *= 100; - return { ...metricPoint, y: metricPoint.y! * 100 }; }); - // cloneServiceErrorRate.metricPoints = wew; - return { ...serviceErrorRate, metricPoints: wew }; };