PHPackages                             calltouch/metric-pusher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. calltouch/metric-pusher

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

calltouch/metric-pusher
=======================

The library provides unified way to push metrics to different storages

v1.0.2(2mo ago)021.3k1MITPHPPHP ^7.1|^8.0

Since Nov 29Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/calltouch/metric-pusher)[ Packagist](https://packagist.org/packages/calltouch/metric-pusher)[ RSS](/packages/calltouch-metric-pusher/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Metric pusher
=============

[](#metric-pusher)

[![Build Status](https://camo.githubusercontent.com/4f68632f73c94bba6e454e217ae5ad7e945a6afba56b51c3ce4aa722520a6c37/68747470733a2f2f7472617669732d63692e6f72672f63616c6c746f7563682f6d65747269632d7075736865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/calltouch/metric-pusher)

The library supports pushing to the following interfaces:

- InfluxDb via [HTTP API](https://docs.influxdata.com/influxdb/v1.3/guides/writing_data/)
- InfluxDb via [UDP plugin](https://docs.influxdata.com/influxdb/v1.3/tools/udp/)

Installation
------------

[](#installation)

Using Composer:

```
composer require calltouch/metric-pusher
```

Usage
-----

[](#usage)

### InfluxDb via HTTP API

[](#influxdb-via-http-api)

```
use Calltouch\MetricPusher\MetricData\{Metric, Tag, TagCollection, Data, DataCollection};
use Calltouch\MetricPusher\Pusher\InfluxDbHttpApiPusher;
use Calltouch\MetricPusher\Collector;

$url = 'http://127.0.0.1:8086';
$db = 'database1';

// optional params
$params = [
    'user' => 'user1', // influx user
    'password' => 'password', // influx password
    'timeout' => 100, // request max timeout in milliseconds
];

$pusher = new InfluxDbHttpApiPusher($url, $db, $params);

$collector = new Collector($pusher);

$tags = new TagCollection;
$tags->add(new Tag('host', gethostname()));

$data = new DataCollection;
$data->add(new Data('value', rand(0, 100)));

$metric = new Metric('metric_name1', $data, $tags);

$collector->sendMetrics([$metric]);
```

### InfluxDb via UDP plugin

[](#influxdb-via-udp-plugin)

```
use Calltouch\MetricPusher\MetricData\{Metric, Tag, TagCollection, Data, DataCollection};
use Calltouch\MetricPusher\Pusher\InfluxDbUdpPusher;
use Calltouch\MetricPusher\Collector;

$host = '127.0.0.1';
$port = '8089';

$pusher = new InfluxDbUdpPusher($host, $port);

$collector = new Collector($pusher);

$tags = new TagCollection;
$tags->add(new Tag('host', gethostname()));

$data = new DataCollection;
$data->add(new Data('value', rand(0, 100)));

$metric = new Metric('metric_name2', $data, $tags);

$collector->sendMetrics([$metric]);
```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance83

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1001 days

Total

4

Last Release

87d ago

PHP version history (2 changes)1.0.0PHP ^7.1

v1.0.1PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c98ccf232061665cf89abf3a7fb693226ea152dcbd177c18e35d17d2f17b0b4?d=identicon)[buddi](/maintainers/buddi)

---

Top Contributors

[![andrey-budik](https://avatars.githubusercontent.com/u/33659307?v=4)](https://github.com/andrey-budik "andrey-budik (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/calltouch-metric-pusher/health.svg)

```
[![Health](https://phpackages.com/badges/calltouch-metric-pusher/health.svg)](https://phpackages.com/packages/calltouch-metric-pusher)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
