Commit 22d6ad75 authored by Sean McGivern's avatar Sean McGivern

Show if the host is a canary host in the perf bar

If the request came from a canary host, show this in the performance bar
by:

1. Adding a bird emoji.
2. Colouring the hostname yellow.
parent 0c9a6c34
<script> <script>
import $ from 'jquery'; import $ from 'jquery';
import { glEmojiTag } from '~/emoji';
import detailedMetric from './detailed_metric.vue'; import detailedMetric from './detailed_metric.vue';
import requestSelector from './request_selector.vue'; import requestSelector from './request_selector.vue';
...@@ -64,6 +65,16 @@ export default { ...@@ -64,6 +65,16 @@ export default {
lineProfileModal() { lineProfileModal() {
return $('#modal-peek-line-profile'); return $('#modal-peek-line-profile');
}, },
hasHost() {
return this.currentRequest && this.currentRequest.details && this.currentRequest.details.host;
},
birdEmoji() {
if (this.hasHost && this.currentRequest.details.host.canary) {
return glEmojiTag('baby_chick');
}
return '';
},
}, },
mounted() { mounted() {
this.currentRequest = this.requestId; this.currentRequest = this.requestId;
...@@ -93,9 +104,11 @@ export default { ...@@ -93,9 +104,11 @@ export default {
class="view" class="view"
> >
<span <span
v-if="currentRequest.details" v-if="hasHost"
class="current-host" class="current-host"
:class="{ 'canary' : currentRequest.details.host.canary }"
> >
<span v-html="birdEmoji"></span>
{{ currentRequest.details.host.hostname }} {{ currentRequest.details.host.hostname }}
</span> </span>
</div> </div>
......
...@@ -605,6 +605,7 @@ $perf-bar-development: #4c1210; ...@@ -605,6 +605,7 @@ $perf-bar-development: #4c1210;
$perf-bar-bucket-bg: #111; $perf-bar-bucket-bg: #111;
$perf-bar-bucket-box-shadow-from: rgba($white-light, 0.2); $perf-bar-bucket-box-shadow-from: rgba($white-light, 0.2);
$perf-bar-bucket-box-shadow-to: rgba($black, 0.25); $perf-bar-bucket-box-shadow-to: rgba($black, 0.25);
$perf-bar-canary-text: $orange-400;
/* /*
Issuable warning Issuable warning
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
} }
} }
.current-host.canary {
color: $perf-bar-canary-text;
}
strong { strong {
color: $white-light; color: $white-light;
} }
......
---
title: Show canary status in the performance bar
merge_request: 22222
author:
type: changed
...@@ -2,7 +2,10 @@ module Peek ...@@ -2,7 +2,10 @@ module Peek
module Views module Views
class Host < View class Host < View
def results def results
{ hostname: Gitlab::Environment.hostname } {
hostname: Gitlab::Environment.hostname,
canary: Gitlab::Utils.to_boolean(ENV['CANARY'])
}
end end
end end
end end
......
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