-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
66 lines (62 loc) · 2.05 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
63
64
65
66
<html>
<head>
<title>k6 dashboard</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" />
</head>
<body onload="M.AutoInit();">
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<a class="brand-logo center">k6 dashboard</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") || "http://127.0.0.1:5665/";
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");
new SimpleChart(src, { title: "Iterations" }, "iterations");
new SimpleChart(src, { title: "Iteration Duration" },
"iteration_duration",
"iteration_duration_95",
"iteration_duration_current");
});
</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>