Skip to content

Commit f0c62da

Browse files
committed
Render version of Perfdash on UI
1 parent 99464a8 commit f0c62da

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

perfdash/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
all: push
22

33
# See deployment.yaml for the version currently running-- bump this ahead before rebuilding!
4+
# Additionally please ensure to update the same in www/VERSION
45
TAG?=2.56
6+
WWW_VERSION=$(shell cat www/VERSION)
57

68
REPO?=gcr.io/k8s-staging-perf-tests
79

810
.PHONY: test
11+
test: WWW_VERSION = $(shell cat www/VERSION)
12+
913
test: perfdash.go parser.go config.go metrics-downloader-helper.go metrics-downloader.go gcs_metrics_bucket.go s3_metrics_bucket.go local_metrics_dir.go
1014
go test
15+
@WWW_VERSION=$$(cat www/VERSION); \
16+
if [ "$(TAG)" != "$$WWW_VERSION" ]; then \
17+
echo "Version mismatch! Makefile=$(TAG), www/VERSION=$(WWW_VERSION). Please align" >&2; \
18+
exit 1; \
19+
fi
1120

1221
perfdash: test
1322
go build -a -installsuffix cgo -ldflags '-w' -o perfdash

perfdash/www/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.56

perfdash/www/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ <h1 class="md-display-2">Performance Dashboard</h1>
5454
</canvas>
5555
<p style="text-align: center">Runs over time</p>
5656
</div>
57-
<p style="font-size: x-small; font-style: italic">
58-
Click a data point to see build logs. CTRL+click anywhere to trim outliers.
57+
<p style="font-size: x-small; font-style: italic; display: flex; justify-content: space-between;">
58+
<span>Click a data point to see build logs. CTRL+click anywhere to trim outliers.</span>
59+
<span>Version: <span id="version"></span></span>
5960
</p>
61+
<script>
62+
fetch('VERSION')
63+
.then(resp => resp.text())
64+
.then(version => document.getElementById('version').innerText = version)
65+
</script>
6066
<!-- Angular Material Dependencies -->
6167
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
6268
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>

0 commit comments

Comments
 (0)