PHPackages                             javer/influxdb-odm-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. javer/influxdb-odm-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

javer/influxdb-odm-bundle
=========================

Provides integration of InfluxDB ODM with Symfony

v1.4.0(2y ago)021.6k[1 issues](https://github.com/javer/JaverInfluxDBBundle/issues)1MITPHPPHP &gt;=8.1

Since Oct 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/javer/JaverInfluxDBBundle)[ Packagist](https://packagist.org/packages/javer/influxdb-odm-bundle)[ Docs](https://github.com/javer/JaverInfluxDBBundle)[ RSS](/packages/javer-influxdb-odm-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (8)Used By (1)

JaverInfluxDBBundle
===================

[](#javerinfluxdbbundle)

This bundle integrates the [InfluxDB Object Document Mapper (ODM) library](https://github.com/javer/influxdb-odm)into Symfony so that you can persist and retrieve objects to and from InfluxDB.

[![Build Status](https://camo.githubusercontent.com/da0ceea3ed22147a83b2f5be3ccb82d589151e8887712eac87c3fcbe00fd9fcb/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a617665722f4a61766572496e666c7578444242756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/javer/JaverInfluxDBBundle)

Compatibility
=============

[](#compatibility)

The current version of this bundle has the following requirements:

- InfluxDB 1.x
- PHP 8.1+
- Symfony 5.4+

Installation
============

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require javer/influxdb-odm-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require javer/influxdb-odm-bundle
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Javer\InfluxDB\Bundle\JaverInfluxDBBundle::class => ['all' => true],
];
```

Configuration
=============

[](#configuration)

```
# config/packages/javer_influx_db.yaml
javer_influx_db:
    url: '%env(INFLUXDB_URL)%'
    mapping_dir: '%kernel.project_dir%/src/Measurement'
    mapping_type: attribute
```

To be able to use annotations, you will have to install an extra package called `doctrine/annotations`.

```
# .env
INFLUXDB_URL=influxdb://localhost:8086/metrics
```

Mapping Configuration
---------------------

[](#mapping-configuration)

Explicit definition of all the mapped measurements is the only necessary configuration for the ODM. The following configuration options exist for a mapping:

- `mapping_dir` - Path to the measurement files

To avoid having to configure lots of information for your mappings you should put all your measurement in a directory `Measurement/` inside your project. For example `src/Measurement/`.

Custom Types
------------

[](#custom-types)

`Custom types` can come in handy when you're missing a specific mapping type or when you want to replace the existing implementation of a mapping type for your measurements.

```
# config/packages/javer_influx_db.yaml
javer_influx_db:
    types:
        custom_type: Fully\Qualified\Class\Name
```

Usage
=====

[](#usage)

Refer to the [influxdb-odm library](https://github.com/javer/influxdb-odm) documentation about declaring, creating, updating and removing measurements.

MeasurementManager
------------------

[](#measurementmanager)

Inject `Javer\InfluxDB\ODM\MeasurementManager` to any service which needs ability to create, update or remove measurements:

```
use App\Measurement\CpuLoad;
use Javer\InfluxDB\ODM\MeasurementManager;

public function demoAction(MeasurementManager $measurementManager)
{
    $now = new DateTime();

    // Create
    $cpuLoad = new CpuLoad();
    $cpuLoad->setTime($now);
    $cpuLoad->setServerId(42);
    $cpuLoad->setCoreNumber(0);
    $cpuLoad->setLoad(3.14);
    $measurementManager->persist($cpuLoad);

    // Fetch
    $cpuLoad = $measurementManager->getRepository(CpuLoad::class)->find($now);

    // Update
    $cpuLoad->setLoad(2.54);
    $measurementManager->persist($cpuLoad);

    // Remove
    $measurementManager->remove($cpuLoad);
}
```

Service Repositories
--------------------

[](#service-repositories)

This bundle adds another way of obtaining a repository instance: use the repository as a service and inject it as a dependency into other services.

```
// src/Repository/CpuLoadRepository.php
namespace App\Repository;

use App\Measurement\CpuLoad;
use Javer\InfluxDB\Bundle\Repository\ServiceMeasurementRepository;
use Javer\InfluxDB\ODM\MeasurementManager;

/**
 * Remember to map this repository in the corresponding measurement repositoryClass.
 */
class CpuLoadRepository extends ServiceMeasurementRepository
{
    public function __construct(MeasurementManager $measurementManager)
    {
        parent::__construct($measurementManager, CpuLoad::class);
    }
}
```

The `ServiceMeasurementRepository` class your custom repository is extending allows you to leverage Symfony's `autowiring` and `autoconfiguration`. To register all of your repositories as services you can use the following service configuration:

```
# config/services.yaml
services:
    _defaults:
        autowire: true
        autoconfigure: true

    App\Repository\:
        resource: '../src/Repository/*'
```

Symfony Profiler Data Collector
-------------------------------

[](#symfony-profiler-data-collector)

This bundle adds a new icon to the Symfony Profiler Toolbar and a new Symfony Profiler Page to enable you to monitor all queries and writes to InfluxDB. It is enabled by default only in development environment.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

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 ~196 days

Recently: every ~245 days

Total

7

Last Release

851d ago

PHP version history (3 changes)v1.0.0PHP &gt;=7.4

v1.1.0PHP &gt;=8.0

v1.4.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e4ae642c5f1ad16c9b07e976096123f9ef8d50ee7df05123ed1e7f55b29caa9?d=identicon)[javer](/maintainers/javer)

---

Top Contributors

[![javer](https://avatars.githubusercontent.com/u/591296?v=4)](https://github.com/javer "javer (15 commits)")

---

Tags

symfonydoctrineodminfluxdb

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/javer-influxdb-odm-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/javer-influxdb-odm-bundle/health.svg)](https://phpackages.com/packages/javer-influxdb-odm-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M648](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[scheb/2fa-bundle

A generic interface to implement two-factor authentication in Symfony applications

6914.0M61](/packages/scheb-2fa-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

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