From 7294884c4be1dc981f89f5bacd7168c721433944 Mon Sep 17 00:00:00 2001 From: nofar9792 Date: Mon, 28 Feb 2022 16:54:17 +0200 Subject: [PATCH 1/2] Monitor Tab - show 95 Latency in a more readable time-unit (#893) * Unit time Signed-off-by: nofar9792 * Use timeConversion Signed-off-by: nofar9792 * Lower case Signed-off-by: nofar9792 --- .../__snapshots__/index.test.js.snap | 6 +++--- .../ServicesView/operationDetailsTable/index.test.js | 6 ++++++ .../Monitor/ServicesView/operationDetailsTable/index.tsx | 3 ++- packages/jaeger-ui/src/utils/date.test.js | 8 ++++---- packages/jaeger-ui/src/utils/date.tsx | 8 ++++---- yarn.lock | 6 +++--- 6 files changed, 22 insertions(+), 15 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 2aa868cff3..bec16d2fba 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 @@ -799,7 +799,7 @@ exports[` render greater than 0.1 requests value in the t
- 736.16 ms + 736ms
@@ -1489,7 +1489,7 @@ exports[` render number with more than 2 decimal places v
- 736.16 ms + 736ms
@@ -2179,7 +2179,7 @@ exports[` render some values in the table 1`] = `
- 736.16 ms + 736ms
diff --git a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.test.js b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.test.js index cddac49a37..761e2d30ea 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.test.js +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.test.js @@ -75,6 +75,12 @@ describe('', () => { expect(wrapper).toMatchSnapshot(); }); + it('render latency in seconds in the table', () => { + const cloneServiceOpsMetrics = {}; + Object.assign(cloneServiceOpsMetrics, serviceOpsMetrics[0]); + cloneServiceOpsMetrics.latency = 8000; + }); + it('render greater than 0.1 requests value in the table', () => { const cloneServiceOpsMetrics = {}; Object.assign(cloneServiceOpsMetrics, serviceOpsMetrics[0]); 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 ddec31fcc0..d0e52759e9 100644 --- a/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.tsx +++ b/packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.tsx @@ -20,6 +20,7 @@ import { MetricsReduxState, ServiceOpsMetrics } from '../../../../types/metrics' import prefixUrl from '../../../../utils/prefix-url'; import './index.css'; +import { timeConversion } from '../../../../utils/date'; type TProps = { data: ServiceOpsMetrics[] | undefined; @@ -82,7 +83,7 @@ export class OperationTableDetails extends React.PureComponent { />
{typeof value === 'number' && row.dataPoints.service_operation_latencies.length > 0 - ? `${value} ms` + ? timeConversion(value * 1000) : ''}
diff --git a/packages/jaeger-ui/src/utils/date.test.js b/packages/jaeger-ui/src/utils/date.test.js index 778f1b5dfb..6caca33b46 100644 --- a/packages/jaeger-ui/src/utils/date.test.js +++ b/packages/jaeger-ui/src/utils/date.test.js @@ -79,18 +79,18 @@ describe('timeConversion', () => { }); it('displays time in seconds', () => { const input = 5000000; - expect(timeConversion(input)).toBe('5Sec'); + expect(timeConversion(input)).toBe('5s'); }); it('displays time in mintues', () => { const input = 120000000; - expect(timeConversion(input)).toBe('2Min'); + expect(timeConversion(input)).toBe('2m'); }); it('displays time in hours', () => { const input = 7200000000; - expect(timeConversion(input)).toBe('2Hrs'); + expect(timeConversion(input)).toBe('2h'); }); it('displays time in days', () => { const input = 172800000000; - expect(timeConversion(input)).toBe('2Days'); + expect(timeConversion(input)).toBe('2d'); }); }); diff --git a/packages/jaeger-ui/src/utils/date.tsx b/packages/jaeger-ui/src/utils/date.tsx index 16f6626652..97ffcc4f9e 100644 --- a/packages/jaeger-ui/src/utils/date.tsx +++ b/packages/jaeger-ui/src/utils/date.tsx @@ -157,13 +157,13 @@ export function timeConversion(microseconds: number) { } else if (milliseconds < 1000) { timeText = `${milliseconds}ms`; } else if (seconds < 60) { - timeText = `${seconds}Sec`; + timeText = `${seconds}s`; } else if (minutes < 60) { - timeText = `${minutes}Min`; + timeText = `${minutes}m`; } else if (hours < 24) { - timeText = `${hours}Hrs`; + timeText = `${hours}h`; } else { - timeText = `${days}Days`; + timeText = `${days}d`; } return timeText; } diff --git a/yarn.lock b/yarn.lock index 2af10e6264..20a507bbb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13057,9 +13057,9 @@ url-loader@1.1.2: schema-utils "^1.0.0" url-parse@^1.1.8, url-parse@^1.4.3: - version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + version "1.5.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.7.tgz#00780f60dbdae90181f51ed85fb24109422c932a" + integrity sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA== dependencies: querystringify "^2.1.1" requires-port "^1.0.0" From 77cdfbdc16517f51951ad142ee5b1da3d40e534f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 15:06:10 +0000 Subject: [PATCH 2/2] Bump actions/setup-node from 2.5.1 to 3 (#896) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.5.1 to 3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v2.5.1...v3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f4ae078a9c..d4c0bc421a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v2.4.0 - - uses: actions/setup-node@v2.5.1 + - uses: actions/setup-node@v3 with: node-version: "10" - name: install yarn