summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/performance_bar/components/simple_metric.vue
blob: 760ea8fe1e60028a42d13d2c26c5a6a2b56143f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script>
  export default {
    props: {
      currentRequest: {
        type: Object,
        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
    :id="`peek-view-${metric}`"
    class="view"
  >
    <span
      v-if="currentRequest.details"
      class="bold"
    >
      {{ duration }}
      /
      {{ calls }}
    </span>
    {{ metric }}
  </div>
</template>