This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
62 lines (58 loc) · 1.81 KB
/
index.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<html>
<head>
<title>example xk6-dashboard UI</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uplot@1.6.12/dist/uPlot.min.css" />
</head>
<body onload="M.AutoInit();">
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<a class="brand-logo center">example xk6-dashboard UI</a>
</div>
</nav>
</div>
<section>
<div class="row">
<div id="charts" class="col s12"></div>
</div>
</section>
<script type="module">
import { SampleSource, SimpleChart } from "./index.js";
addEventListener("DOMContentLoaded", () => {
const endpoint = new URLSearchParams(window.location.search).get("endpoint") || "/";
const src = new SampleSource(`${endpoint}events/sample`);
new SimpleChart(src, { title: "Virtual Users" }, "vus");
new SimpleChart(
src,
{ title: "Request Duration (ms)" },
"http_req_duration_95",
"http_req_duration_90",
"http_req_duration_50",
"http_req_duration_current"
);
new SimpleChart(src, { title: "Request Rate (1/s)" }, "http_reqs_rate");
});
</script>
<style>
/* css */
nav .brand-logo {
font-size: 20px;
line-height: 40px;
}
nav {
background: #7b65fa;
height: 40px;
}
body {
background: #f0f0f0;
}
.navbar-fixed {
height: 45px;
}
</style>
</body>
</html>