diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-09-27 07:45:48 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-09-27 07:45:48 +0000 |
commit | e373b2e972abcb585b9958878ba00f4a8b32b2c3 (patch) | |
tree | 2a823b4a471e11a3ff7df52e7c145a4903e1c5ef /app/assets | |
parent | 44fbb7a8b2f9e3e8029869c8d95693f0715e5311 (diff) | |
download | gitlab-ce-e373b2e972abcb585b9958878ba00f4a8b32b2c3.tar.gz |
Fixes performance bar looking for a key in a undefined prop
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/performance_bar/components/performance_bar_app.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/performance_bar/components/simple_metric.vue | 37 |
2 files changed, 26 insertions, 13 deletions
diff --git a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue index 7836d4f3b09..1522e2227e4 100644 --- a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue +++ b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue @@ -42,7 +42,7 @@ export default { keys: ['feature', 'request'], }, ], - simpleMetrics: ['redis', 'sidekiq'], + simpleMetrics: ['redis'], data() { return { currentRequestId: '' }; }, diff --git a/app/assets/javascripts/performance_bar/components/simple_metric.vue b/app/assets/javascripts/performance_bar/components/simple_metric.vue index b654bc66249..760ea8fe1e6 100644 --- a/app/assets/javascripts/performance_bar/components/simple_metric.vue +++ b/app/assets/javascripts/performance_bar/components/simple_metric.vue @@ -1,16 +1,29 @@ <script> -export default { - props: { - currentRequest: { - type: Object, - required: true, + export default { + props: { + currentRequest: { + type: Object, + required: true, + }, + metric: { + type: String, + required: true, + }, }, - metric: { - type: String, - required: true, + computed: { + duration() { + return ( + this.currentRequest.details[this.metric] && + this.currentRequest.details[this.metric].duration + ); + }, + calls() { + return ( + this.currentRequest.details[this.metric] && this.currentRequest.details[this.metric].calls + ); + }, }, - }, -}; + }; </script> <template> <div @@ -21,9 +34,9 @@ export default { v-if="currentRequest.details" class="bold" > - {{ currentRequest.details[metric].duration }} + {{ duration }} / - {{ currentRequest.details[metric].calls }} + {{ calls }} </span> {{ metric }} </div> |