ProductPromotion
Logo

PHP

made by https://0x3d.site

GitHub - beberlei/metrics: Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.
Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in. - beberlei/metrics
Visit Site

GitHub - beberlei/metrics: Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.

GitHub - beberlei/metrics: Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.

Metrics

Build Status

Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics API that doesn't cause vendor lock-in.

It also ships with a Symfony Bundle. This is not a library for displaying metrics.

Currently supported backends:

  • Doctrine DBAL
  • Graphite
  • InfluxDB
  • Telegraf
  • Librato
  • Logger (Psr\Log\LoggerInterface)
  • Null (Dummy that does nothing)
  • Prometheus
  • StatsD
  • Zabbix
  • DogStatsD

Installation

Using Composer:

composer require beberlei/metrics

API

You can instantiate clients:

<?php

$collector = \Beberlei\Metrics\Factory::create('statsd');

You can measure stats:

<?php

$collector->increment('foo.bar');
$collector->decrement('foo.bar');

$start = microtime(true);
$diff  = microtime(true) - $start;
$collector->timing('foo.bar', $diff);

$value = 1234;
$collector->measure('foo.bar', $value);

Some backends defer sending and aggregate all information, make sure to call flush:

<?php

$collector->flush();

Configuration

<?php
$statsd = \Beberlei\Metrics\Factory::create('statsd');

$zabbix = \Beberlei\Metrics\Factory::create('zabbix', array(
    'hostname' => 'foo.beberlei.de',
    'server'   => 'localhost',
    'port'     => 10051,
));

$zabbixConfig = \Beberlei\Metrics\Factory::create('zabbix_file', array(
    'hostname' => 'foo.beberlei.de',
    'file'     => '/etc/zabbix/zabbix_agentd.conf'
));

$librato = \Beberlei\Metrics\Factory::create('librato', array(
    'hostname' => 'foo.beberlei.de',
    'username' => 'foo',
    'password' => 'bar',
));

$null = \Beberlei\Metrics\Factory::create('null');

Symfony Bundle Integration

Register Bundle into Kernel:

<?php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        //..
        $bundles[] = new \Beberlei\Bundle\MetricsBundle\BeberleiMetricsBundle();
        //..
    }
}

Do Configuration:

# app/config/config.yml
beberlei_metrics:
    default: foo
    collectors:
        foo:
            type: statsd
        bar:
            type: zabbix
            prefix: foo.beberlei.de
            host: localhost
            port: 10051
        baz:
            type: zabbix_file
            prefix: foo.beberlei.de
            file: /etc/zabbix/zabbix_agentd.conf
        librato:
            type: librato
            username: foo
            password: bar
            source: hermes10
        dbal:
            type: doctrine_dbal
            connection: metrics # using the connection named "metrics"
        monolog:
            type: monolog
        influxdb:
            type: influxdb
            influxdb_client: influxdb_client_service # using the InfluxDB client service named "influxdb_client_service"
            tags:
                dc: "west"
                node_instance: "hermes10"
        prometheus:
            type: prometheus
            prometheus_collector_registry: prometheus_collector_registry_service # using the Prometheus collector registry service named "prometheus_collector_registry_service"
            namespace: app_name # optional
            tags:
                dc: "west"
                node_instance: "hermes10"

This adds collectors to the Metrics registry. The functions are automatically included in the Bundle class so that in your code you can just start using the convenient functions. Metrics are also added as services:

<?php

$metrics = $container->get('beberlei_metrics.collector.foo');

and the default collector can be fetched:

<?php

$metrics = $container->get('beberlei_metrics.collector');

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory