# redo-monolith

> Express middleware for your log-to-`statsd` needs.

Latest version **3.0.0** (published 2017-04-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install redo-monolith
pnpm add redo-monolith
yarn add redo-monolith
bun add redo-monolith
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2017-04-19 |
| First published | 2016-09-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | restorando |
| Keywords | statsd, monolith, express |

## Links

- npm: https://www.npmjs.com/package/redo-monolith
- Repository: https://github.com/restorando/monolith
- Homepage: https://github.com/restorando/monolith#readme
- Issues: https://github.com/restorando/monolith/issues
- npm.io page: https://npm.io/package/redo-monolith

## Dependencies (2)

- [lynx](https://npm.io/package/lynx.md) ^0.2.0
- [microtime](https://npm.io/package/microtime.md) ^2.1.2

## Recent versions

- 3.0.0 (latest) — 2017-04-19
- 2.0.0 — 2017-04-05
- 1.0.1 — 2017-03-02
- 1.0.0 — 2017-02-22
- 0.1.2 — 2017-02-20
- 0.1.1 — 2017-02-20
- 0.1.0 — 2016-09-05

## README

# Monolith
Express middleware for your log-to-`statsd` needs.

## Installation

```
npm install --save redo-monolith
```

## Usage

```js
var monolith = require('redo-monolith');
var statsd = monolith({
  host: '127.0.0.1',
  port: 8125,
  queueHeader: 'X-Request-Start'
});
```

### As an `express` middleware

```js
var express = require('express');
var app = express();

function sendFn(params) {
  /**
   *  `params` is an object with the following attributes for logging what you want about the request:
   *  queueDuration: amount of time since the request has been enqueued by `nginx` until the request finishes
   *  requestDuration: amount of time since the request started to be processed by `express` until it finishes
   *  status: a `String` representation of the resulting HTTP status code
   *  req: an `express#Request` object
   *  res: an `express#Response` object
   *  client: a `lynx` instance
   */

  params.client.increment(params.status);
}

app.use(statsd.middleware({ send: sendFn }))
```

### As a standalone statsd client

```js
statsd.client.increment('myMetric');
```

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