-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_1MiB.chart.html
116 lines (113 loc) · 3.18 KB
/
db_1MiB.chart.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" />
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.5.1/dist/chart.min.js"></script>
<title>db_1MiB</title>
<style>
body {
margin: 0;
padding: 0;
background: #ddd;
}
.container {
box-sizing: border-box;
height: 96vh;
width: 96vw;
margin: 2vh 2vw;
resize: both;
overflow: hidden;
padding: 20px;
background: white;
box-shadow: 0 0 15px #aaa;
}
</style>
</head>
<body>
<div class="container">
<canvas id="chart1687684110521" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
const [whole, fraction] = String(num).split('.')
const chunked = []
whole
.split('')
.reverse()
.forEach((char, index) => {
if (index % 3 === 0) {
chunked.unshift([char])
} else {
chunked[0].unshift(char)
}
})
const fractionStr = fraction !== undefined ? '.' + fraction : ''
return (
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1687684110521 = document
.getElementById('chart1687684110521')
.getContext('2d')
const chart1687684110521 = new Chart(ctx1687684110521, {
type: 'bar',
data: {
labels: ["get 1 MiB of data","put 1 MiB of data","put zero data","put zero data then del"],
datasets: [
{
data: [907,674,36178,17949],
backgroundColor: ["hsl(3.0120000000000062, 85%, 55%)","hsl(2.2319999999999993, 85%, 55%)","hsl(120, 85%, 55%)","hsl(59.532, 85%, 55%)"],
borderColor: ["hsl(3.0120000000000062, 85%, 55%)","hsl(2.2319999999999993, 85%, 55%)","hsl(120, 85%, 55%)","hsl(59.532, 85%, 55%)"],
borderWidth: 2,
},
],
},
options: {
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'db_1MiB',
font: { size: 20 },
padding: 20,
},
legend: {
display: false,
},
tooltip: {
callbacks: {
label: (context) => {
return format(context.parsed.y) + ' ops/s'
},
},
displayColors: false,
backgroundColor: '#222222',
padding: 10,
cornerRadius: 5,
intersect: false,
},
},
scales: {
x: {
grid: {
color: '#888888',
},
},
y: {
title: {
display: true,
text: 'Operations per second',
padding: 10,
},
grid: {
color: '#888888',
},
},
},
},
})
</script>
</body>
</html>