Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Snapshot Profiler Newrelic Laravel Package

aeatech/snapshot-profiler-newrelic

View on GitHub
Deep Wiki
Context7

AEATech - Snapshot profiler newrelic

Code Coverage

The package contains implementation of aeatech/snapshot-profiler-contracts to profile applications with newrelic. It can be used for production profiling.

System requirements:

  • PHP >= 8.2
  • ext-newrelic (tested on 12.1+)

Installation (Composer):

composer require aeatech/snapshot-profiler-newrelic

Quick start

<?php
declare(strict_types=1);

use AEATech\SnapshotProfiler\Profiler;
use AEATech\SnapshotProfilerNewrelic\Adapter;
use AEATech\SnapshotProfilerNewrelic\Saver;

require_once 'vendor/autoload.php';

/**
 * Start initialization
 */
$saver = new Saver();
$adapter = new Adapter('appName', 'license');
$profiler = new Profiler($adapter);
$profilingOptions = [
    Adapter::OPTION_KEY_SNAPSHOT_NAME => 'snapshot name',
    /**
     * It must be true for cli processes or false for web processes
     */
    Adapter::OPTION_KEY_IS_BACKGROUND_PROCESS => true,
    Adapter::OPTION_KEY_CUSTOM_PARAMETERS => [
        'parameter 1' => true,
        'parameter 2' => 2,
        'parameter 3' => 3.14,
        'parameter 4' => 'string value',
    ],
];
/**
 * End initialization
 */

/**
 * Start profiling
 */
$profiler->enable();
$profiler->setProfilingOptions($profilingOptions);

for ($i = 0; $i < 10; $i++) {
    random_int(1, 10);
}

/**
 * $data is always empty and added for backward compatibility with xhprof
 */
$data = $profiler->disable();
/**
 * End profiling
 */

/**
 * Start customization (not necessarily)
 */

/**
 * Save profiling result
 * It's doing nothing and added for backward compatibility with xhprof
 */
$saver->save($data);

License

MIT License. See LICENSE for details.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gsferro/filament-odometer-easy
gsferro/filament-stat-plus-easy
jeffersongoncalves/filament-barcode-field
martin6363/filament-sidebar-resize
graystackit/laravel-dymo-printer
phpinnacle/money
lastdragon-ru/lara-asp-documentator
tumutech/laravel-qr-code
babenkoivan/elastic-scout-driver-plus
socialiteproviders/apple
phpshko/laravel-livewire-depdrop
larasell-dev/larasell
calliostro/spotify-bundle
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle