PHPackages                             qwerkon/code-usage - 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. qwerkon/code-usage

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

qwerkon/code-usage
==================

Laravel telemetry package that tracks which controllers, jobs, events and commands have run.

1.0.1(5mo ago)13MITPHPPHP ^8.4

Since Jan 22Pushed 5mo agoCompare

[ Source](https://github.com/qwerkon/code-usage)[ Packagist](https://packagist.org/packages/qwerkon/code-usage)[ RSS](/packages/qwerkon-code-usage/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (10)Versions (3)Used By (0)

Code Usage Telemetry
====================

[](#code-usage-telemetry)

Laravel package that ships the runtime telemetry tooling used detect which controllers, jobs, events, listeners and commands actually run in production.

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

[](#installation)

```
composer require qwerkon/code-usage
```

The package is auto-discovered but you can manually register `Qwerkon\CodeUsage\Providers\CodeUsageServiceProvider` in `config/app.php` if needed.

Configuration
-------------

[](#configuration)

Publish the default configuration when you first install the package:

```
php artisan vendor:publish --tag=code-usage-config
```

Key settings:

- `code_usage.enabled` – master switch (set via `CODE_USAGE_ENABLED`).
- `code_usage.sample_rate` – float between 0.0 and 1.0 to sample hits.
- `code_usage.throttle_per_minute` – maximum records per symbol per minute.
- `code_usage.include_namespaces` / `exclude_namespaces` – limit what symbols are tracked.
- `code_usage.meta_enabled` – whether to persist contextual metadata.
- `code_usage.queue_connection` / `queue_name` – configure where `FlushCodeUsageBatchJob` runs.

Runtime
-------

[](#runtime)

When enabled the package:

1. Registers the `track-code-usage` middleware to log each routed controller action.
2. Swaps the event dispatcher to capture event/listener invocations.
3. Hooks `JobProcessing`, `JobProcessed`, `CommandStarting`, `CommandFinished` to track jobs and commands.
4. Buffers hits per request and flushes via `FlushCodeUsageBatchJob` (with a sync fallback).

The buffer uses `code_usage_hits`/`code_usage_symbols`/`code_usage_meta` tables defined in the bundled migrations.

Artisan helpers
---------------

[](#artisan-helpers)

- `php artisan code-usage:report` – prints top hitters and “never seen” symbols per kind.
- `php artisan code-usage:prune --days=30` – removes hits older than `retention_days`.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance71

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Every ~0 days

Total

2

Last Release

162d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5518662?v=4)[Krzysztof Bielecki](/maintainers/qwerkon)[@qwerkon](https://github.com/qwerkon)

---

Top Contributors

[![qwerkon](https://avatars.githubusercontent.com/u/5518662?v=4)](https://github.com/qwerkon "qwerkon (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/qwerkon-code-usage/health.svg)

```
[![Health](https://phpackages.com/badges/qwerkon-code-usage/health.svg)](https://phpackages.com/packages/qwerkon-code-usage)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k90.5k1](/packages/mike-bronner-laravel-model-caching)

PHPackages © 2026

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