Skip to content

Commit

Permalink
Fix histogram scrape performance (#219)
Browse files Browse the repository at this point in the history
Fixes #216
  • Loading branch information
nowells authored and SimenB committed Sep 19, 2018
1 parent 6a71f47 commit 45e0c3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
### Changed

- Allow setting Gauge values to NaN, +Inf, and -Inf
- Fixed `histogram` scrape performance by using `acc.push` instead of `acc.concat`. Fixes #216 with #219

### Added

Expand Down
2 changes: 1 addition & 1 deletion lib/histogram.js
Expand Up @@ -288,7 +288,7 @@ function extractBucketValuesForExport(histogram) {

function addSumAndCountForExport(histogram) {
return (acc, d) => {
acc = acc.concat(d.buckets);
acc.push(...d.buckets);

const infLabel = Object.assign({ le: '+Inf' }, d.data.labels);
acc.push(
Expand Down

0 comments on commit 45e0c3e

Please sign in to comment.