2017 © Pedro Peláez
 

symfony-bundle metrics-bundle

FlagbitMetricsBundle provides easy integration of metrics collector services for the Symfony Framework

image

flagbit/metrics-bundle

FlagbitMetricsBundle provides easy integration of metrics collector services for the Symfony Framework

  • Thursday, July 19, 2018
  • by flagbit
  • Repository
  • 28 Watchers
  • 1 Stars
  • 338 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

FlagbitMetricsBundle Build Status Scrutinizer Code Quality SensioLabsInsight

About

The FlagbitMetricsBundle provides easy integration for the metrics collector library of Bejamin Eberlei into Symfony2., (*1)

Installation

Using Composer

Installation with composer:, (*2)

composer require flagbit/metrics-bundle

Register the bundle

measure('foo.bar', $value);
    }
}
```

### Create your Service

Once you have created your metric provider class, let's go to create the service. In order the metric collector service 
automatically to collect all the metrics of your metric provider service, you just need to use the "metrics.provider" 
service tag and select so many collectors as you want.

#### YAML

```yml
services:
    Flagbit\ExampleBundle\MetricProvider\Provider:
        tags:
            - { name: metrics.provider, collector: statsd }
            - { name: metrics.provider, collector: librato }
```
#### XML

```xml

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services
        http://symfony.com/schema/dic/services/services-1.0.xsd"
>
    <services>
        <service id="Flagbit\ExampleBundle\MetricProvider\Provider">
            <tag name="metrics.provider" collector="statsd" />
            <tag name="metrics.provider" collector="librato" />
        </service>
    </services>
</container>

Collect your Metrics

You can collect all metrics by yourself and after flush them to your metric servers or use the command that does it for you instead., (*3)

<?php

// Collects the metrics of all your tagged services...
$container->get('flagbit_metrics.provider_invoker')->collectMetrics();
// ... and flush them
$container->get('flagbit_metrics.provider_invoker')->onTerminate();

It is recommended to inject the services into yours instead of using directly the container., (*4)

Command

$ php bin/console flagbit:metrics:flush

The Versions

19/07 2018

dev-master

9999999-dev https://github.com/Flagbit/FlagbitMetricsBundle

FlagbitMetricsBundle provides easy integration of metrics collector services for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

logging metrics

19/07 2018

2.0.0

2.0.0.0 https://github.com/Flagbit/FlagbitMetricsBundle

FlagbitMetricsBundle provides easy integration of metrics collector services for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

logging metrics

11/07 2018

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/Flagbit/FlagbitMetricsBundle

FlagbitMetricsBundle provides easy integration of metrics collector services for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

logging metrics

22/05 2015

dev-improvements

dev-improvements https://www.flagbit.de

FlagbitMetricsBundle provides easy integration of metrics collector services for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

logging metrics

23/10 2014

1.0.1

1.0.1.0 https://github.com/Flagbit/FlagbitMetricsBundle

FlagbitMetricsBundle for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

logging metrics

17/10 2014

1.0.0

1.0.0.0 https://github.com/Flagbit/FlagbitMetricsBundle

FlagbitMetricsBundle for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

logging metrics