debian-mirror-gitlab/app/assets/javascripts/performance_bar/components/simple_metric.vue

34 lines
699 B
Vue
Raw Normal View History

2018-05-09 12:01:36 +05:30
<script>
2018-12-13 13:39:08 +05:30
export default {
props: {
currentRequest: {
type: Object,
required: true,
2018-05-09 12:01:36 +05:30
},
2018-12-13 13:39:08 +05:30
metric: {
type: String,
required: true,
2018-05-09 12:01:36 +05:30
},
2018-12-13 13:39:08 +05:30
},
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
);
},
},
};
2018-05-09 12:01:36 +05:30
</script>
<template>
2019-02-15 15:39:39 +05:30
<div :id="`peek-view-${metric}`" class="view">
<span v-if="currentRequest.details" class="bold"> {{ duration }} / {{ calls }} </span>
2018-05-09 12:01:36 +05:30
{{ metric }}
</div>
</template>