Commit 64bf653e authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen
parent 0132dc4a
...@@ -54,17 +54,17 @@ export default { ...@@ -54,17 +54,17 @@ export default {
return this.currentRequest.details[this.metric]; return this.currentRequest.details[this.metric];
}, },
metricDetailsSummary() { metricDetailsSummary() {
const summary = {} const summary = {};
if (!this.metricDetails.summaryOptions || !this.metricDetails.summaryOptions.hideTotal) { if (!this.metricDetails.summaryOptions || !this.metricDetails.summaryOptions.hideTotal) {
summary[s__('Total')] = this.metricDetails.calls summary[s__('Total')] = this.metricDetails.calls;
} }
if (!this.metricDetails.summaryOptions || !this.metricDetails.summaryOptions.hideDuration) { if (!this.metricDetails.summaryOptions || !this.metricDetails.summaryOptions.hideDuration) {
summary[s__('PerformanceBar|Total duration')] = this.metricDetails.duration summary[s__('PerformanceBar|Total duration')] = this.metricDetails.duration;
} }
return {...summary, ...(this.metricDetails.summary || {})} return { ...summary, ...(this.metricDetails.summary || {}) };
}, },
metricDetailsLabel() { metricDetailsLabel() {
if (this.metricDetails.duration && this.metricDetails.calls) { if (this.metricDetails.duration && this.metricDetails.calls) {
......
/* eslint-disable @gitlab/require-i18n-strings */ /* eslint-disable @gitlab/require-i18n-strings */
import Vue from 'vue'; import Vue from 'vue';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { s__ } from '~/locale';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
import initPerformanceBarLog from './performance_bar_log'; import initPerformanceBarLog from './performance_bar_log';
...@@ -82,9 +83,9 @@ const initPerformanceBar = (el) => { ...@@ -82,9 +83,9 @@ const initPerformanceBar = (el) => {
const domContentLoaded = Math.round(navigationEntries[0].domContentLoadedEventEnd); const domContentLoaded = Math.round(navigationEntries[0].domContentLoadedEventEnd);
summary = { summary = {
Backend: backend, [s__('PerformanceBar|Backend')]: backend,
'First contentful paint': firstContentfulPaint, [s__('PerformanceBar|First contentful paint')]: firstContentfulPaint,
'Dom content loaded': domContentLoaded, [s__('PerformanceBar|Dom content loaded')]: domContentLoaded,
}; };
durationString = `${backend} | ${firstContentfulPaint} | ${domContentLoaded}`; durationString = `${backend} | ${firstContentfulPaint} | ${domContentLoaded}`;
...@@ -122,7 +123,7 @@ const initPerformanceBar = (el) => { ...@@ -122,7 +123,7 @@ const initPerformanceBar = (el) => {
start: entry.startTime, start: entry.startTime,
name: entry.name.replace(document.location.origin, ''), name: entry.name.replace(document.location.origin, ''),
duration: Math.round(entry.duration), duration: Math.round(entry.duration),
size: entry.transferSize ? `${nf.format(entry.transferSize)} bytes` : 'cached', size: entry.transferSize ? `${nf.format(entry.transferSize)} ${s__('bytes')}` : 'cached',
}; };
}, },
}, },
......
---
title: Enable chronological sort order for other items in the performance bar
merge_request: 58572
author:
type: changed
...@@ -131,8 +131,8 @@ describe('detailedMetric', () => { ...@@ -131,8 +131,8 @@ describe('detailedMetric', () => {
details: requestDetails, details: requestDetails,
warnings: ['gitaly calls: 456 over 30'], warnings: ['gitaly calls: 456 over 30'],
summaryOptions: { summaryOptions: {
hideTotal: true hideTotal: true,
} },
}, },
}, },
}, },
...@@ -155,8 +155,8 @@ describe('detailedMetric', () => { ...@@ -155,8 +155,8 @@ describe('detailedMetric', () => {
details: requestDetails, details: requestDetails,
warnings: ['gitaly calls: 456 over 30'], warnings: ['gitaly calls: 456 over 30'],
summaryOptions: { summaryOptions: {
hideDuration: true hideDuration: true,
} },
}, },
}, },
}, },
...@@ -184,8 +184,8 @@ describe('detailedMetric', () => { ...@@ -184,8 +184,8 @@ describe('detailedMetric', () => {
}, },
summaryOptions: { summaryOptions: {
hideDuration: true, hideDuration: true,
hideTotal: true hideTotal: true,
} },
}, },
}, },
}, },
...@@ -193,10 +193,7 @@ describe('detailedMetric', () => { ...@@ -193,10 +193,7 @@ describe('detailedMetric', () => {
}); });
it('displays a summary section', () => { it('displays a summary section', () => {
expect(findAllSummaryItems()).toEqual([ expect(findAllSummaryItems()).toEqual(['In controllers 100', 'In middlewares 20']);
'In controllers 100',
'In middlewares 20',
]);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment