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(3mo ago)13MITPHPPHP ^8.4

Since Jan 22Pushed 3mo 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 1mo ago

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

38

—

LowBetter than 85% of packages

Maintenance78

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

116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22b1f2c0af980de23d6c650aca3768c8923512b390c3eefce0fcfe9ec66996c6?d=identicon)[qwerkon](/maintainers/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.

9682.1M97](/packages/roots-acorn)[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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