{"name":"prometheus-gc-stats","version":"0.3.2","description":"Report Garbage Collection stats using Prometheus","main":"index.js","files":["index.js"],"scripts":{"compile":"babel gc-metrics.js -o index.js","lint":"eslint .","prepublish":"not-in-install && npm run compile || in-install","postpublish":"git push --follow-tags","pretest":"npm run lint","test":"echo \"Error: no test specified\""},"keywords":["garbage-collection","gc","metrics","prometheus","prom","statsd"],"author":{"name":"Simen Bekkhus","email":"sbekkhus91@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/simenb/node-prometheus-gc-stats.git"},"optionalDependencies":{"gc-stats":"^1.0.0"},"dependencies":{"optional":"^0.1.3","gc-stats":"^1.0.0"},"peerDependencies":{"prom-client":">= 3.2 < 8"},"devDependencies":{"babel-cli":"^6.16.0","babel-plugin-add-module-exports":"^0.2.1","babel-preset-es2015":"^6.16.0","eslint":"^3.9.1","eslint-config-simenb-base":"^9.0.0","in-publish":"^2.0.0","prom-client":"^7.0.0"},"gitHead":"574ff02323912ff5c53918f67d41ca9fec39809e","bugs":{"url":"https://github.com/simenb/node-prometheus-gc-stats/issues"},"homepage":"https://github.com/simenb/node-prometheus-gc-stats#readme","_id":"prometheus-gc-stats@0.3.2","_shasum":"e5772ee124627feb4d9169a2ffcc8de082951b81","_from":".","_npmVersion":"4.0.5","_nodeVersion":"6.9.1","_npmUser":{"name":"simenb","email":"sbekkhus91@gmail.com"},"dist":{"shasum":"e5772ee124627feb4d9169a2ffcc8de082951b81","tarball":"http://registry-npm.ywwl.com/prometheus-gc-stats/download/prometheus-gc-stats-0.3.2.tgz","integrity":"sha512-b2CA2gV/UXyKLOlLNsli3MlgAl0WtCPT5q+JETB6bPHe5+MNh29ERTIre40D8j2VCKL4RqEToix4FdVkiheYbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDizegEuc65u8JD+u7PpTBVx6WeLMYxfhf4hWZg0lUl8AIhAMGi0Cr2BR5naWBEyLxXpQoZBCfGMkH1063Vp3mHdUW/"}],"size":3489,"noattachment":false,"key":"/prometheus-gc-stats/-/prometheus-gc-stats-0.3.2.tgz"},"maintainers":[{"name":"simenb","email":"sbekkhus91@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/prometheus-gc-stats-0.3.2.tgz_1483629963473_0.3137441352009773"},"directories":{},"readme":"# prometheus-gc-stats\n\n> Report Garbage Collection stats using Prometheus\n\n[![NPM Version][npm-image]][npm-url]\n[![Build Status][circle-ci-image]][circle-ci-url]\n\n## Usage\n\nThis module has a peer dependency on [`prom-client`](https://github.com/siimon/prom-client). Currently, 10-14 is supported.\n\nNote that version 12 and up of `prom-client` comes with GC metrics out of the box, so this module might not be needed. See [this comment](https://github.com/siimon/prom-client/pull/361#discussion_r400430717).\n\nThis module follows the same API as the core default metrics. To start collection GC stats, invoke the exported function to create the\nmetrics, then invoke the returned function to start the collecting.\n\nThe exported function takes a single parameter, which is a registry. If provided, and the version of prom-client you use support it, that is\nthe registry which the metrics will register to. If no registry is provided it will use the default one provided by `prom-client`.\n\nExample:\n\n```js\nconst prometheus = require('prom-client');\nconst gcStats = require('prometheus-gc-stats');\n\nprometheus.collectDefaultMetrics();\nconst startGcStats = gcStats(prometheus.register); // gcStats() would have the same effect in this case\nstartGcStats();\n```\n\n### `gc-stats`\n\nThe module doing the GC stats collecting is [`gc-stats`](https://github.com/dainis/node-gcstats). This module requires native dependencies.\nIf the stats don't show up, make sure to check `npm`'s install log for failures.\n\n## Metrics exposed\n\nThis module exposes 3 metrics:\n\n1. `nodejs_gc_runs_total`: Counts the number of time GC is invoked\n2. `nodejs_gc_pause_seconds_total`: Time spent in GC in seconds\n3. `nodejs_gc_reclaimed_bytes_total`: The number of bytes GC has freed\n\nYou can add a prefix to metric names using options:\n\n```js\nconst startGcStats = gcStats(prometheus.register, {\n  prefix: 'my_application_',\n});\n```\n\n## Credits\n\nThanks to @tcolgate for the original implementation.\n\n[circle-ci-url]: https://circleci.com/gh/SimenB/node-prometheus-gc-stats\n[circle-ci-image]: https://circleci.com/gh/SimenB/node-prometheus-gc-stats/tree/main.svg?style=shield&circle-token=05b6e173edee3b1494b0370d5d3caea00ad358a3\n[npm-url]: https://npmjs.org/package/prometheus-gc-stats\n[npm-image]: https://img.shields.io/npm/v/prometheus-gc-stats.svg\n","publish_time":1483629964073,"_cnpm_publish_time":1483629964073,"dist-tags":{"latest":"1.1.0"}}