# statto-client

> A client for statto - easy to use.

Latest version **0.1.1** (published 2015-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install statto-client
pnpm add statto-client
yarn add statto-client
bun add statto-client
```

## 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.1.1 |
| Published | 2015-04-02 |
| First published | 2015-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrew Chilton |
| Maintainers | chilts |
| Keywords | statto, stats, statsd |

## Links

- npm: https://www.npmjs.com/package/statto-client
- Repository: https://github.com/tynio/statto-client
- Issues: https://github.com/tynio/statto-client/issues
- npm.io page: https://npm.io/package/statto-client

## Recent versions

- 0.1.1 (latest) — 2015-04-02
- 0.1.0 — 2015-04-02

## README

# statto-client #

A client for statto - easy to use.

## Synopsis ##

```js
var stattoClient = require('statto-client')

// create a client (also takes params for host and port
var client = stattoClient()
var client = stattoClient({ host : 'localhost', port : 9526 })

// a counter - the number of requests we've received
client.send('c:server.request:1')

// a gauge - the amount of free memory
client.send('m:mem.free.tatooine:111964160') // tatooine is the server

// a timer - the elapsed request time to a database
client.send('t:db.time:23') // e.g. 23ms
```

You can also send multiple stats in the same packet. To do that just pass an array
of any of the above:

```js
// multiple counters - request count AND memory gauge AND database timer
client.send([ 'c:server.request:1', 'm:mem.free.tatooine:111964160', 't:db.time:23' ])
```

## Methods ##

There are also convenience methods for all of the above. These signatures are as follows:

* `.counter(name, inc=1)`
* `.gauge(name, amount)`
* `.timer(name, time)`
* `.set(name, value)`

Just the counter `amount` has a default of one. All other amounts/values/times must be provided.

## Author ##

Written by [Andrew Chilton](http://chilts.org/) - [Twitter](https://twitter.com/andychilton).

Written for [Tynio](https://tyn.io/) so we can use a statsd-like daemon in a much easier way. Our use-case involves a
stats callback which writes each file to Rackspace's Cloud Files, which are aggregated in a separate process elsewhere.
ie. the stats daemon is not where the hard work is, it's pretty easy.

## License ##

The MIT License (MIT)

Copyright 2015 Tynio Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

(Ends)

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