定制 spiria-digital/laravel-statsd 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spiria-digital/laravel-statsd

Composer 安装命令:

composer require spiria-digital/laravel-statsd

包简介

Send to Statsd server from Laravel

README 文档

README

Allows you to seamlessly send data to a Statsd server from within your Laravel application.

Packagist License Build Status

Installation

Add Spiria-Digital\laravel-statsd package with composer

composer require Spiria-Digital/laravel-statsd:5.5.1

Update your packages with composer update or install with composer install.

Laravel >5.5

Since version 5.5, Laravel support Package Auto-Discovery, which means that Service Provider and aliases can be added automatically through the package composer file. Therefore, once Composer has installed or updated your packages Laravel-Statsd should be registered as a service provider and should provide the Statsd Facade.

Laravel <5.4

If you are using an older verison of Laravel you must add the provider and the alias manually.

You can register Statsd with Laravel by opening up app/config/app.php and adding the providers key in the providers array:

'Spiria-Digital\Statsd\StatsdServiceProvider'

You will also need to register the facade so that you can access it within your application. To do this add the following to your aliases in app/config/app.php:

'Statsd' => 'Spiria-Digital\Statsd\Facades\Statsd'

Configuration

Statsd configuration file can be extended by creating app/config/statsd.php. You can find the default configuration file under vendor/Spiria-Digital/laravel-statsd/config/config.php.

You can quickly publish a configuration file by running the following Artisan command.

$ php artisan config:publish Spiria-Digital/laravel-statsd

Usage

Laravel-Statsd exposes the following functions to send data to Statsd:

Statsd::timing($key, $time);
Statsd::gauge($key, $value);
Statsd::set($key, $value);
Statsd::increment($key);
Statsd::decrement($key);
Statsd::updateCount($key, $delta);

The data is automatically sent to Statsd at the end of Laravels life-cycle, but you can force data to be sent with:

Statsd::send()

Note: Data will only be sent to Statsd if your environment matches the environments defined in the config file.

This package is an updated version of rcrowe/laravel-statsd and has been tested with laravel 5.4+ only. It does not currently support Lumen.

统计信息

  • 总下载量: 147
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固