Coder Social home page Coder Social logo

statsdclientbundle's Introduction

StatsD Client Bundle

Total Downloads Latest Stable Version Build Status

This bundle helps you to monitor your application.

It uses statsd-php-client as Client for the etsy/Statsd API.

It Includes

  • a Service, a Factory and an Entity callable by the DIC
  • a Monolog Handler
  • a series of Collectors in order to aggregate your personal data.
  • a series of Commands in order to execute data also from cli.

Check out the documentation

Articles

Abstract

Monitoring what is happening in your production Symfony2 application, with StatsD and Graphite.

Within this bundle you could use ready-to-go monitor for

  • Monolog

  • Amount of visitor

  • Logged vs Anonymous user

  • SQL: Verbs used (amount of select/set/update/upgrade/delete) (this feature is not suggested, please use a server monitor tool eg. nagios, munin)

  • Amount of PHP ram used

  • You could create your own using the Factory and the Service.

On dev env the data are not pushed to the socket but to syslog.

If debug mode is enabled no packet are sent over the udp socket, and you could see what's going on reading the syslog with tail -f /var/log/syslog

Mar 19 00:48:11 liuggio nginx: statsd-open
Mar 19 00:48:11 liuggio nginx: statsd-write "tvision.visitor:1|tvision.memory:43520|tvision.user.anonymous:1|tvision.query.start:1|tvision.query.insert:1|c" 118 Bytes
Mar 19 00:48:11 liuggio nginx: statsd-close

Note: by default in dev environment debug is true.

One UDP packet to rule them all

With a proper config file, your StatsD server will receive in a single upd packet:

prefix.visitor:1|c                  # Increment visitor
prefix.user.anonymous:1|c           # The visitor is not logged

prefix.log.app.error.user_action:1  # Stats by monolog with $this->get('logger')->error('user_action')

prefix.memory:4480|g                # The php memory peak was 4480 MB

prefix.exception.exception.500:1|c  # Exception occurred, the Exception code was 500

prefix.query.insert:1|c             # Query Insert
prefix.query.select:1|c             # Query Select

Short Theory and links

Vagrant StatSD and Graphite

see this blog post to install Easy install statsd graphite with vagrant.

StatsD

StatsD is a simple daemon for easy stats aggregation

Graphite

Graphite is a Scalable Realtime Graphing

The Client send data with UDP (faster)

https://www.google.com/search?q=tcp+vs+udp

Contribution

Active contribution and patches are very welcome. To keep things in shape we have quite a bunch of unit tests. If you're submitting pull requests please make sure that they are still passing and if you add functionality please take a look at the coverage as well it should be pretty high :)

  • First fork or clone the repository
git clone git://github.com/liuggio/StatsDClientBundle.git
cd StatsDClientBundle
  • Install vendors:
php composer.phar install --dev
  • This will give you proper results:
phpunit --coverage-html reports

Contributors

https://github.com/liuggio/StatsDClientBundle/graphs/contributors

statsdclientbundle's People

Contributors

jdeniau avatar jfouca avatar liuggio avatar pborreli avatar pgodel avatar tristanbes avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.