jhmilan / stats-collector by jhmilan

Send stats to Statsd with Laravel easily
354
1
1
Package Data
Maintainer Username: jhmilan
Maintainer Contact: jhmilan@gmail.com (Jose H. Milán)
Package Create Date: 2016-05-15
Package Last Update: 2016-05-19
Language: PHP
License: MIT
Last Refreshed: 2024-04-23 03:12:58
Package Statistics
Total Downloads: 354
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 1
Total Forks: 0
Total Open Issues: 1

StatsCollector

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.