承接 basilicom-pimcore-plugin/librato 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

basilicom-pimcore-plugin/librato

最新稳定版本:1.0.0

Composer 安装命令:

composer require basilicom-pimcore-plugin/librato

包简介

Configure and use Librato metrics with Pimcore

README 文档

README

Codacy Badge Dependency Status Scrutinizer Code Quality Build Status SensioLabsInsight

Developer info: Pimcore at basilicom

Synopsis

This Pimcore http://www.pimcore.org plugin simplifies recording stats and metrics to the Librato service.

Code Example / Method of Operation

If installed and enabled, the plugin hooks into the maintenance process/script of pimcore (via the "system.maintenance" event) and sends custom metric values every five minutes to the Librato servers.

Metrics can be defined via SQL queries and/or static methods.

Motivation

Monitoring business values is a crucial part of every application. Librato is a powerful external service for recording metrics and analyzing stats. This plugin makes Pimcore integration easy by using a simple config file and hooking into the maintenance/cronjob process.

Installation

Add "basilicom-pimcore-plugin/librato" as a requirement to the composer.json in the toplevel directory of your Pimcore installation.

Example:

{
    "require": {
        "basilicom-pimcore-plugin/librato": "~1.0"
    }
}

Install the plugin via the Pimcore Extension Manager.

Press the "Configure" button of the Librato plugin from within the Extension Manager and set the "email" and "token" properties to the values from your Librato account ( https://metrics.librato.com/account/api_tokens ).

The current Pimcore database name is used as default metric source. Use the "source" property to override this.

Define some metrics. These examples cover all the possiblities:

<metrics>
    <metric><type>counter</type><name>object_cnt</name><sql>select count(*) as cnt from `objects`</sql></metric>
    <metric><type>counter</type><name>version_cnt</name><sql>select count(*) as cnt from `versions`</sql></metric>
    <metric><type>gauge</type><name>php_sample_method</name><php>\Librato\Plugin::getSampleRandomMetric</php></metric>
</metrics>

Please note: The SQL queries and php static methods must return exactly one numerical value suitable for Librato API consumption. Types "counter" and "gauge" are supported.

Change the "enabled" property to "1" to enable sending of values.

API Reference

If you want to send metrics to librato not on the maintenance run, but manually - use the following methods:

  • &\Librato\Plugin::getClient() returns a \Librato\Client configured and ready for sending metrics. Returns a dummy client if plugin is not configured/enabled.
  • \Librato\Client->addGauge(string $name, int|float $value) - adds a gauge metric
  • \Librato\Client->addCounter(string $name, int|float $value) - adds a counter metric
  • \Librato\Client->flush() - sends metrics buffer to Librato

Tests

  • none

Todo

  • Implement a simple Pimcore Dashboard Widget for Librato integration

Contributors

License

  • BSD-3-Clause

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固