Skip to content

Commit

Permalink
Add more stats
Browse files Browse the repository at this point in the history
  • Loading branch information
XciD committed Jul 5, 2023
1 parent f0c53ce commit ce54d63
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/metrics/heapStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ module.exports = (registry, config = {}) => {

// Use this one metric's `collect` to set all metrics' values.
gauge.collect = () => {
let heapStatistics = v8.getHeapStatistics();
for (const stat of heapStatistics) {
gauge.set({stat: stat, ...labels}, heapStatistics[stat])
for (const [stat, value] of Object.entries(v8.getHeapStatistics())) {
gauge.set({stat: stat, ...labels}, value)
}
};
};
Expand Down

0 comments on commit ce54d63

Please sign in to comment.