# docker-stats

> All your docker containers statistics as a stream

Latest version **0.9.0** (published 2018-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install docker-stats
pnpm add docker-stats
yarn add docker-stats
bun add docker-stats
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2018-11-22 |
| First published | 2015-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 6 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Peter Elger |
| Maintainers | matteo.collina, pelger |
| Keywords | docker, container, stats, statistics |

## Links

- npm: https://www.npmjs.com/package/docker-stats
- Repository: https://github.com/pelger/docker-stats
- Homepage: https://github.com/pelger/docker-stats#readme
- Issues: https://github.com/pelger/docker-stats/issues
- npm.io page: https://npm.io/package/docker-stats

## Dependencies (6)

- [pump](https://npm.io/package/pump.md) ^3.0.0
- [split2](https://npm.io/package/split2.md) ^2.2.0
- [minimist](https://npm.io/package/minimist.md) ^1.1.1
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [never-ending-stream](https://npm.io/package/never-ending-stream.md) ^2.0.0
- [docker-allcontainers](https://npm.io/package/docker-allcontainers.md) ^0.8.0

## Recent versions

- 0.9.0 (latest) — 2018-11-22
- 0.8.0 — 2018-01-11
- 0.7.2 — 2017-04-14
- 0.7.1 — 2017-01-26
- 0.7.0 — 2016-06-20
- 0.6.0 — 2016-06-09
- 0.5.1 — 2016-01-11
- 0.5.0 — 2015-08-19
- 0.4.0 — 2015-06-08
- 0.3.0 — 2015-05-06
- 0.2.1 — 2015-04-20
- 0.2.0 — 2015-02-16
- 0.1.1 — 2015-02-13
- 0.1.0 — 2015-02-13

## README

# docker-stats

Collect all your Docker stats!

## Install

```sh
npm install docker-stats --save
```

## Usage

```
var stats = require('docker-stats')
var through = require('through2')
var opts = {
  docker: null, // here goes options for Dockerode
  events: null, // an instance of docker-allcontainers

  statsinterval: 10, // downsample stats. Collect a number of statsinterval logs
                     // and output their mean value

  // the following options limit the containers being matched
  // so we can avoid catching logs for unwanted containers
  matchByName: /hello/, // optional
  matchByImage: /matteocollina/, // optional
  skipByName: /.*pasteur.*/, // optional
  skipByImage: /.*dockerfile.*/ // optional
}
stats(opts).pipe(through.obj(function(chunk, enc, cb) {
  this.push(JSON.stringify(chunk))
  this.push('\n')
  cb()
})).pipe(process.stdout)
```

## Acknowledgements

This project was kindly sponsored by [nearForm](http://nearform.com).

## License

MIT

---
_Source: https://npm.io/package/docker-stats · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
