PHPackages                             danilopolani/filament-memory-tracker - 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. danilopolani/filament-memory-tracker

ActiveLibrary

danilopolani/filament-memory-tracker
====================================

Track the memory usage of your workers and display them in Filament

v2.1.1(3y ago)27903MITPHPPHP ^8.0

Since Jul 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/danilopolani/filament-memory-tracker)[ Packagist](https://packagist.org/packages/danilopolani/filament-memory-tracker)[ Docs](https://github.com/danilopolani/filament-memory-tracker)[ Fund](https://www.buymeacoffee.com/theraloss)[ GitHub Sponsors](https://github.com/danilopolani)[ RSS](/packages/danilopolani-filament-memory-tracker/feed)WikiDiscussions 2.x Synced today

READMEChangelog (6)Dependencies (6)Versions (9)Used By (0)

Filament Memory Tracker
=======================

[](#filament-memory-tracker)

[![Latest Stable Version](https://camo.githubusercontent.com/7358b8c0703cb3f30906ec9cff91d5323c4db89c7cbb21d30b0c8db1daeb2e56/687474703a2f2f706f7365722e707567782e6f72672f64616e696c6f706f6c616e692f66696c616d656e742d6d656d6f72792d747261636b65722f76)](https://packagist.org/packages/danilopolani/filament-memory-tracker)[![Total Downloads](https://camo.githubusercontent.com/82f92adbc49b9cb5fd92afc1378b3d3c795c20529046b5c155d7594a7be008dd/687474703a2f2f706f7365722e707567782e6f72672f64616e696c6f706f6c616e692f66696c616d656e742d6d656d6f72792d747261636b65722f646f776e6c6f616473)](https://packagist.org/packages/danilopolani/filament-memory-tracker)

Track the memory usage of your workers and display them in Filament.

[![Filament Worker Memory widget preview](https://camo.githubusercontent.com/406e1be65dd6c7f61970adeca059e9654492bd896e0b05ca3869057b38fa2ee8/68747470733a2f2f692e696d6775722e636f6d2f5935676e57666c2e706e67)](https://camo.githubusercontent.com/406e1be65dd6c7f61970adeca059e9654492bd896e0b05ca3869057b38fa2ee8/68747470733a2f2f692e696d6775722e636f6d2f5935676e57666c2e706e67)

> If you're using Filament v1, please navigate the [1.x branch](https://github.com/danilopolani/filament-memory-tracker/tree/1.x).

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

[](#installation)

Install the package via composer:

```
composer require danilopolani/filament-memory-tracker
```

Then publish the assets and the config of the package:

```
php artisan vendor:publish --tag=filament-memory-tracker-assets
php artisan vendor:publish --tag=filament-memory-tracker-config
```

> If you're upgrading from v1 to v2 please note that the namespace changed from `\DaniloPolani\` to `\DaniloPolani\`.

### Upgrade

[](#upgrade)

When upgrading be sure to republish the assets:

```
php artisan vendor:publish --tag=filament-memory-tracker-assets --force
```

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

[](#configuration)

There are a few notable configuration options for the package.

KeyTypeDescription`cache_store`StringDefine the cache store used to track memory usage. By default it will be your `CACHE_DRIVER` env value.`trackers`ArrayA list of trackers names to be displayed in the dashboard. They must be the same used in your `MemoryTracker()` instance. See **Usage** below to discover more.`date_format`StringThe [DateTime format](https://www.php.net/manual/en/datetime.format.php) to display dates.Usage
-----

[](#usage)

In your Worker create a new `MemoryTracker` instance and then ping the `track()` method every time you want. There's an example with [ReactPHP Event Loop](https://reactphp.org/event-loop/).

ℹ️The `$realUsage` flag is the same as [memory\_get\_usage()](https://www.php.net/manual/en/function.memory-get-usage.php).```
