jhmilan/stats-collector

Send stats to Statsd with Laravel easily

0.1.7 2016-05-19 20:41 UTC

This package is not auto-updated.

Last update: 2024-04-23 19:29:23 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Just a small Laravel5 wrapper over Domnikl\Statsd to send data to StatsD/Graphite really easily.

Install

Via Composer

$ composer require jhmilan/StatsCollector

Setup

Add the service provider to your config.app.php

Jhmilan\StatsCollector\ServiceProvider::class,

Add the facade to your config.app.php

'StatsCollector' => Jhmilan\StatsCollector\Facades\StatsCollector::class,

Publish the config file (a new config/statscollector.php file will be created, populate your .env as per the variables in the file)

php artisan vendor:publish --provider="Jhmilan\StatsCollector\StatsCollectorServiceProvider"

Usage

Send timers, countes, etc just calling a method! (see /src/Services/StatsD.php to figure out which methods are available)

echo StatsCollecor::time('foo.bar', 300);
...

Add this middleware to your App Middleware to auto collect (config based), request time, request memory usage and request DB operations

Jhmilan\StatsCollector\Http\Middleware\CollectorMiddleware

To-do

This package is still WIP, no time for tests or good docs yet! sorry

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email jhmilan@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.