Skip to content

Commit

Permalink
fix: Fix data collection when not every events contains all metrics (#28
Browse files Browse the repository at this point in the history
)
  • Loading branch information
szkiba committed Aug 18, 2023
1 parent 718cb44 commit 5ede59b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion assets/brief/index.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions assets/packages/brief/src/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Metrics {
pushOne (key, value) {
if (!this.values.hasOwnProperty(key)) {
this.values[key] = Array(this.length)
} else if (this.values[key].length < this.length) {
this.values[key][this.length-1] = undefined
}

this.values[key].push(roundTo(value, 4))
Expand Down
2 changes: 2 additions & 0 deletions assets/packages/ui/src/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Metrics {
pushOne (key, value) {
if (!this.values.hasOwnProperty(key)) {
this.values[key] = Array(this.length)
} else if (this.values[key].length < this.length) {
this.values[key][this.length-1] = undefined
}

this.values[key].push(roundTo(value, 4))
Expand Down

Large diffs are not rendered by default.

33 changes: 18 additions & 15 deletions assets/ui/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./xk6-dashboard.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" src="./boot.js"></script>
<script type="module" src="./init.js"></script>
<title>k6 dashboard</title>
<script type="module" crossorigin src="./assets/index-aa15e9e4.js"></script>
<link rel="stylesheet" href="./assets/index-fd5c5824.css">
</head>
<body>
<div id="root"></div>

</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./xk6-dashboard.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" src="./boot.js"></script>
<script type="module" src="./init.js"></script>
<title>k6 dashboard</title>
<script type="module" crossorigin src="./assets/index-ec9aa95e.js"></script>
<link rel="stylesheet" href="./assets/index-fd5c5824.css">
</head>

<body>
<div id="root"></div>

</body>

</html>

0 comments on commit 5ede59b

Please sign in to comment.