• Stars
    star
    164
  • Rank 230,032 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easily monitor your symfony2 production env., with ready-to-use stats.

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.

Simple usage!

$this->get('statsd')
     ->increment('log.error')
     ->gauge('log.rate', 25)
     ->flush();

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

See CONTRIBUTING.md

Contributors

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

More Repositories

1

fastest

Simple parallel testing execution... with some goodies for functional tests.
PHP
473
star
2

ExcelBundle

Excel integration in Symfony2 thanks to https://github.com/PHPOffice/PHPExcel library
PHP
374
star
3

symfony2-rest-api-the-best-2013-way

Code for the article at:
PHP
152
star
4

statsd-php-client

Statsd (Object Oriented) client library for PHP
PHP
114
star
5

spawn

Handling concurrent PHP processes
PHP
29
star
6

DDD-dummy-blog-with-symfony2

PHP
29
star
7

HelpDeskBundle

NOT MANTAINED!!!! Open source support ticket system. (Symfony2 bundle)
JavaScript
24
star
8

sized140

Something like a framework in PHP with 6 components of 140 chars
PHP
18
star
9

liuggio.github.com

My personal blog on jekyll
HTML
8
star
10

Ultra-Lightweight-Dependency-Injector-Python

Lightweight Dependency Injector Setter Python -10 lines! Tiny DIS in Python.
8
star
11

RackspaceCloudFilesBundle

[MOVED!!!!! see tvision/RackspaceCloudFilesBundle ]Symfony2 bundle to manage Rackspace Cloud Files, This Bundle borns as fork of the escapestudios/EscapeRackspaceCloudFilesBundle, now these two bundles are very different.
PHP
8
star
12

filler-dto

Retrieve and set properties from and to a DTO.
PHP
7
star
13

godfather

[moved to PUGX] library that helps you with the Strategy Pattern
PHP
6
star
14

events

Crazy Fast Event Dispatcher for Golang - Be careful no reflection here...
Go
5
star
15

KnpMenuExtensionBundle

[USE KNP-MENU-BUNDLE THEY ADDED THE YML FUNCTIONALITY ]Extends the KnpMenu, you can configure, create or add nodes to the menu from any bundle, only adding rows in the bundle's config file
PHP
4
star
16

docker-workshop-orchestration

Container orchestration workshop
Shell
3
star
17

deBergmannizer

This is a stupid tool that removes the name of the creator from PHPUnit.
3
star
18

http

Trying to define a standard for the HttpInterface and middlewares.
PHP
3
star
19

docker-workshop

Full Day Workshop about Docker and Bashism
Shell
2
star
20

phpspec2-playground

PHPSpec2 by examples. Just a place to play as a kid, with BDD in PHP
PHP
2
star
21

UserBundle

Instance of the UserBundle read https://github.com/FriendsOfSymfony/FOSUserBundle
2
star
22

golang-stupid-microservice

just a microservice playground
Go
2
star
23

backupMysqlEnv

move database tables between the dev, test, live environment or just gzip
Shell
1
star
24

s3sync

Docker container: backup and sync folder into a Aws S3 bucket.
Shell
1
star
25

RackspaceCloudFilesStreamWrapper

MOVED TO TVISION Library to stream file for rackspace
PHP
1
star
26

git-current-branch-bashrc

Add the current git branch to bashrc
1
star
27

xwc-sandbox

OBSOLETE CODE - xwc-sanbox is an attempt to create a modular CMS running on symfony2, allowing to easily create sites from ready made components (bundles)
PHP
1
star
28

EmenseneImageTimer

< ~2008 / DEPRECATED - This simple(stupid) plug-in allows you to update (at time intervals) your emesene avatar by picking one image from the images folder.
Python
1
star