2017 © Pedro Peláez
 

library ts-profiler

Tiny and simple profiler

image

satmaelstorm/ts-profiler

Tiny and simple profiler

  • Monday, May 1, 2017
  • by satmaelstorm
  • Repository
  • 0 Watchers
  • 0 Stars
  • 650 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 4 % Grown

The README.md

TSProfiler

Tiny and Simple PHP-runtime Profiler, (*1)

This component allows you to profile the code directly in the production environment., (*2)

You can use it as a Singleton:, (*3)

$profiler = ProfilerSingletone::getInstance();

Also, if you want disable profiling at this time, you can use:, (*4)

$profiler = ProfilerSingletone::getInstance(false);

So, if you don't want use Singleton, you can use:, (*5)

$profiler = new Profiler();

or, (*6)

$profiler = new Profiler(false);

when you don't need profiler at this time, (*7)

This case very useful, when you want to use TSProfiler as Symfony service, or in another framework, which will ensure the uniqueness of the existence of a class instance., (*8)

For profiling, trackers are created using the addTracker method. Each tracker can store data in its own way. The profiling data will save the class that implements the ShutdownInterface interface. You can write any plug-in - save with sql-server, file, Monolog or some other way., (*9)

$tracker = $profiler->addTracker($name, $saver);

If you want disable this tracker at this time:, (*10)

$tracker = $profiler->addTracker($name, $saver, false);

Example with CSVSaver class:, (*11)

$tracker = $profiler->addTracker(
    'csvTracker',
    new \satmaelstorm\TSProfiler\TSProfilerShutdown\CSVSaver('\tmp'); 
                                );

After creating the tracker, you wrap the profiled lines using the startJob and stopJob methods of the tracker., (*12)

$tracker->startJob('jobName');
//profiled code
$tracker->stopJob('jobName');

The Versions

01/05 2017

dev-master

9999999-dev

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler

01/05 2017

dev-develop

dev-develop

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler

22/04 2017

v1.1.2

1.1.2.0

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler

22/04 2017

1.1.3

1.1.3.0

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler

22/04 2017

v1.1

1.1.0.0

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler

22/04 2017

v1.1.1

1.1.1.0

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler

22/04 2017

v1.0

1.0.0.0

Tiny and simple profiler

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Vladislav Sidorin

profiler