hexanet/swarrot-statsd-bundle

此包已被废弃,不再维护。未建议替代包。

使用 M6Web/StatsdBundle 向 stastd 发送数据的 Swarrot 处理器

v1.0.0 2017-10-11 06:47 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:07:50 UTC


README

Total Downloads Latest stable Version

Swarrot 处理器,用于通过 M6Web/StatsdBundle 向 stastd 发送数据。

安装

使用 Symfony Flex 的应用程序

打开命令行控制台,进入您的项目目录并执行

$ composer require hexanet/swarrot-statsd-bundle

不使用 Symfony Flex 的应用程序

步骤 1:下载包

打开命令行控制台,进入您的项目目录并执行以下命令以下载此包的最新稳定版本

$ composer require hexanet/swarrot-statsd-bundle

此命令需要您全局安装了 Composer,如 Composer 文档中的 安装章节 所述。

步骤 2:启用包

然后,通过将其添加到项目 app/AppKernel.php 文件中注册的包列表中来启用包

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Hexanet\SwarrotStatsdBundle\HexanetSwarrotStatsdBundle(),
        );

        // ...
    }

    // ...
}

使用方法

在您的 config.yml 文件中,您可以添加一个中间件处理器,用于将事件发送到使用我的 M6Web/StatsdBundle。

swarrot:
    consumers:
        eligibility:
            processor: processor.eligibility
            middleware_stack:
                - configurator: hexanet_swarrot_statsd.processor.statsd
                  extras:
                      name: eligibility
                - configurator: swarrot.processor.ack
        populate_ticket:
            processor: processor.populate_ticket
            middleware_stack:
                # no extra data with message name so the queue name is used instead
                - configurator: hexanet_swarrot_statsd.processor.statsd
                - configurator: swarrot.processor.ack

m6_statsd:
    clients:
        default:
            servers: ['default']
            events:
                swarrot_statsd.message.success:
                    increment: "si.eligibility-service.message.<messageName>.success"
                    timing: "si.eligibility-service.message.<messageName>"
                swarrot_statsd.message.error:
                    increment: "si.eligibility-service.message.<messageName>.error"
                    timing: "si.eligibility-service.message.<messageName>"
                    immediate_send: true

致谢

Hexanet 开发。

许可证

SwarrotStatsdBundleMIT 许可证 下授权。