Skip to content
statd support for node in typescript
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
results.bin
tsconfig.json

README.md

Service Meddler

Build Status Coverage Status

statd support for node appplications written in typescript

Warining :: WIP

This project is on an early stage and under heavy development. API can change without notice

Configuration

There is a simple factory function that initialize Meddler globaly

import *  as meddler from './meddler';

...

 meddler.configure("localhost",8125,"demoNodeApp") 
 // host and port of the statd server and the name of the application 

Decorators

  • timer: method decorator that cronograph the execution time
  • count: method decorator that count how many times the method is called
  • countKey: same as count but with a custom key

Express support

Automagicaly collects duration and status for each request

import * as meddlerExpress from './express-meddler';
import *  as meddler from './meddler';
    
    class App {

    public express: express.Application;

     constructor() {
        this.express = express();
        this.middleware();
        this.routes();
    }

    private middleware(): void {
        meddler.configure("localhost",8125,"demoNodeApp")
        this.express.use(meddlerExpress.middleware())
    }

    }

Using a reporting service

You can send statd data to a rapero server like Graphite and Grafana and monitor your service stats in real time

## Roadmap
  • Support for hapi
You can’t perform that action at this time.