Skip to content

Commit

Permalink
DEV: commit generated modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Nov 4, 2023
1 parent eca7c69 commit 31d7022
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dist/cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ class CustomMetrics {
value = 0;
count = 0;
}
else if (statistic == 'current') {
value = 0;
count = 0;
}
else if (statistic.match(/^p[0-9]+/)) {
pvalues = [];
}
Expand All @@ -301,15 +305,24 @@ class CustomMetrics {
if (point.max != undefined) {
value = Math.max(value, point.max);
}
else {
value = Math.max(value, point.sum / (point.count || 1));
}
}
else if (statistic == 'min') {
if (point.min != undefined) {
value = Math.min(value, point.min);
}
else {
value = Math.min(value, point.sum / (point.count || 1));
}
}
else if (statistic == 'sum') {
value += point.sum;
}
else if (statistic == 'current') {
value = point.sum / (point.count || 1);
}
else if (statistic == 'count') {
value += point.count;
}
Expand Down
13 changes: 13 additions & 0 deletions dist/mjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ export class CustomMetrics {
value = 0;
count = 0;
}
else if (statistic == 'current') {
value = 0;
count = 0;
}
else if (statistic.match(/^p[0-9]+/)) {
pvalues = [];
}
Expand All @@ -309,15 +313,24 @@ export class CustomMetrics {
if (point.max != undefined) {
value = Math.max(value, point.max);
}
else {
value = Math.max(value, point.sum / (point.count || 1));
}
}
else if (statistic == 'min') {
if (point.min != undefined) {
value = Math.min(value, point.min);
}
else {
value = Math.min(value, point.sum / (point.count || 1));
}
}
else if (statistic == 'sum') {
value += point.sum;
}
else if (statistic == 'current') {
value = point.sum / (point.count || 1);
}
else if (statistic == 'count') {
value += point.count;
}
Expand Down

0 comments on commit 31d7022

Please sign in to comment.