PHPackages                             rcsofttech/console-profiler-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. [CLI &amp; Console](/categories/cli)
4. /
5. rcsofttech/console-profiler-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

rcsofttech/console-profiler-bundle
==================================

A live, non-blocking TUI profiler dashboard for Symfony console commands. Displays real-time memory, duration, and SQL query metrics.

v1.0.0(3mo ago)1612↓90%2[3 issues](https://github.com/rcsofttech85/ConsoleProfilerBundle/issues)MITPHPPHP &gt;=8.4CI passing

Since Mar 25Pushed 3mo agoCompare

[ Source](https://github.com/rcsofttech85/ConsoleProfilerBundle)[ Packagist](https://packagist.org/packages/rcsofttech/console-profiler-bundle)[ RSS](/packages/rcsofttech-console-profiler-bundle/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Console Profiler Bundle
=======================

[](#console-profiler-bundle)

[![CI](https://github.com/rcsofttech85/ConsoleProfilerBundle/actions/workflows/ci.yaml/badge.svg)](https://github.com/rcsofttech85/ConsoleProfilerBundle/actions/workflows/ci.yaml)[![Version](https://camo.githubusercontent.com/ae2248aaf6a9f6a6a3a72374534457de444675df8bf7455c1b3c374ef213b067/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7263736f6674746563682f636f6e736f6c652d70726f66696c65722d62756e646c652e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/rcsofttech/console-profiler-bundle)[![Codacy Badge](https://camo.githubusercontent.com/b959bc84e392035691b887e8d389f5e09c5024c41d05750e1e436fa7fe7db933/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3832386633653330326365383431383561306230626566646163356631623237)](https://app.codacy.com/gh/rcsofttech85/ConsoleProfilerBundle/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Codacy Badge](https://camo.githubusercontent.com/ff21036ab31be0a5d9dbd849fc5eb7f77c0049a2d034a53b0da4aa6045c9ddf4/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3832386633653330326365383431383561306230626566646163356631623237)](https://app.codacy.com/gh/rcsofttech85/ConsoleProfilerBundle/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

If you've ever watched a long-running Symfony console command crawl and wondered, "Is this thing leaking memory? Am I hammering the database with N+1 queries right now?" — this bundle is for you.

The standard Symfony Profiler is amazing for HTTP requests, but it doesn't help you much when a queue worker is eating up RAM in the background. The Console Profiler Bundle hooks right into your terminal to give you a live, **premium TUI dashboard** while your commands are actually running.

[![Console Profiler Dashboard](docs/dashboard.png)](docs/dashboard.png)

---

Features
--------

[](#features)

- Live, auto-refreshing TUI dashboard pinned to the top of your terminal
- Memory usage, peak memory, and growth rate with color-coded bars
- Real-time trend indicators (`↑` `↓` `→`) for memory and SQL
- CPU user/system time tracking via `getrusage()`
- Automatic SQL query counting via Doctrine DBAL 4 Middleware
- JSON profile export for CI pipeline regression testing
- Exit code stamping on command completion
- Zero configuration required — works out of the box
- Graceful degradation without `ext-pcntl` (no auto-refresh)

---

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

[](#installation)

Pop it into your dev dependencies via Composer:

```
composer require --dev rcsofttech/console-profiler-bundle
```

*Note: You'll need PHP 8.4+, Symfony 8.0+, and the `ext-pcntl` extension (which you probably already have on Mac/Linux) to get the smooth async UI updates.*

---

Configuration (Optional)
------------------------

[](#configuration-optional)

You don't have to configure anything, it works right out of the box. But if you want to tweak things, create `config/packages/console_profiler.yaml`:

```
console_profiler:
    # Disable the profiler entirely if you want
    enabled: true

    # It's smart enough to turn itself off when kernel.debug is false
    exclude_in_prod: true

    # How often the TUI updates (in seconds)
    refresh_interval: 1

    # Don't bother profiling these noisy default commands
    # (these four are the defaults — add your own as needed)
    excluded_commands:
        - 'list'
        - 'help'
        - 'completion'
        - '_complete'

    # Set this to a path to save a JSON dump for CI regression testing
    profile_dump_path: '%kernel.project_dir%/var/log/profiler/last_run.json'
```

---

Practical Examples
------------------

[](#practical-examples)

### 1. Debugging a leaky queue worker

[](#1-debugging-a-leaky-queue-worker)

Run your worker normally:

```
bin/console messenger:consume async
```

Look at the **Memory** row in the profiler. You'll see a `+X MB/s` indicator showing exactly how fast memory is growing. If it holds steady into the yellow or red, you know you've got a leak to fix.

### 2. Guarding against N+1 queries in CI

[](#2-guarding-against-n1-queries-in-ci)

Set your `profile_dump_path` in `console_profiler.yaml`. Then, in your CI run:

```
# Run your heavy sync command
bin/console app:nightly-sync

# Check if someone blew up the query count using jq
SQL_COUNT=$(jq '.counters.sql_queries' var/log/profiler/last_run.json)

if [ "$SQL_COUNT" -gt 500 ]; then
  echo "Whoops! Regression: SQL queries exceeded 500 (got $SQL_COUNT)"
  exit 1
fi
```

The JSON dump tracks memory, CPU times, SQL counts, and more.

---

JSON Profile Schema
-------------------

[](#json-profile-schema)

When `profile_dump_path` is configured, the following JSON is written on command completion:

```
{
  "timestamp": "2024-01-15T10:30:00+00:00",
  "command": "app:import-data",
  "environment": "dev",
  "exit_code": 0,
  "duration_seconds": 12.4523,
  "memory": {
    "usage_bytes": 16777216,
    "peak_bytes": 33554432,
    "limit_bytes": 268435456,
    "growth_rate_bytes_per_sec": 524288.0
  },
  "cpu": {
    "user_seconds": 8.12,
    "system_seconds": 0.34
  },
  "counters": {
    "sql_queries": 142,
    "loaded_classes": 312,
    "declared_functions": 1204,
    "included_files": 89,
    "gc_cycles": 2
  },
  "system": {
    "php_version": "8.4.12",
    "sapi": "cli",
    "pid": 12345,
    "opcache_enabled": true,
    "xdebug_enabled": false
  }
}
```

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/my-feature`)
3. Ensure tests pass: `vendor/bin/phpunit`
4. Ensure static analysis passes: `vendor/bin/phpstan analyze`
5. Submit a pull request

License
-------

[](#license)

MIT License.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance79

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acf551384df4ef2ac01cd242fa6d3ffa5bbb9ce7a9d4c685923f27f9d38aa706?d=identicon)[rcsofttech85](/maintainers/rcsofttech85)

---

Top Contributors

[![rcsofttech85](https://avatars.githubusercontent.com/u/17738213?v=4)](https://github.com/rcsofttech85 "rcsofttech85 (1 commits)")

---

Tags

profilersymfonysymfony-bundlesymfony-consoletuimiddlewareconsolesymfonyprofilerdashboardtui

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rcsofttech-console-profiler-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/rcsofttech-console-profiler-bundle/health.svg)](https://phpackages.com/packages/rcsofttech-console-profiler-bundle)
```

PHPackages © 2026

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