Download the PHP package danilopolani/filament-memory-tracker without Composer

On this page you can find all versions of the php package danilopolani/filament-memory-tracker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-memory-tracker

Filament Memory Tracker

Latest Stable Version Total Downloads

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

Filament Worker Memory widget preview

If you're using Filament v1, please navigate the 1.x branch.

Installation

Install the package via composer:

Then publish the assets and the config of the package:

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

Upgrade

When upgrading be sure to republish the assets:

Configuration

There are a few notable configuration options for the package.

Key Type Description
cache_store String Define the cache store used to track memory usage. By default it will be your CACHE_DRIVER env value.
trackers Array A 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 String The DateTime format to display dates.

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.

ℹ️ The $realUsage flag is the same as memory_get_usage().

Then don't forget to add your tracker name inside the configuration too:

Track restarts

You can track the latest Worker restart date and memory usage as well! If you're working on a custom Worker, you should intercept the exit signals and then call the $memoryTracker->trackRestart() method. Otherwise you can use the Trait provided by the package to achieve that:

  1. Include DaniloPolani\FilamentMemoryTracker\Concerns\TracksRestart inside your class;
  2. Call $this->trackRestartMemory(MemoryTracker $memoryTrackerInstance) inside your constructor.
⚠️ The TracksRestart requires the extension pcntl to be enabled.

Laravel Queue

You can track Laravel Queue too by listening to some specific events in a provider, for example your AppServiceProvider.

Additional notes

Memory Tracker widget single block

APIs

These are the available methods of the MemoryTracker class:

Key Description
track(): void Track the current memory usage for the worker.
trackRestart(bool $resetPeak = true): void Track a restart. If $resetPeak is true, the memory peak will be purged as well.
getHistory(): array Get the worker's history of memory usage.
getPeak(): array\|null Get the worker's memory peak. Returns null if no peak found.
getLatestRestart(): array\|null Get the worker's latest restart data. Returns null if no restart found.
purge(): void Purge all the data of the current worker.
purgeHistory(): void Purge the track history only of the current worker.
purgePeak(): void Purge the memory peak of the current worker.
purgeRestart(): void Purge the latest restart data of the current worker.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of filament-memory-tracker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
filament/filament Version ^2.5
illuminate/support Version ^8.0|^9.0|^10.0
illuminate/contracts Version ^8.0|^9.0|^10.0
livewire/livewire Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package danilopolani/filament-memory-tracker contains the following files

Loading the files please wait ....