2017 © Pedro Peláez
 

library jank-profiler

A profiler for when you don't want to figure out profilers.

image

colindecarlo/jank-profiler

A profiler for when you don't want to figure out profilers.

  • Saturday, March 7, 2015
  • by colindecarlo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Jank Profiler

For when you don't want to figure out actual profilers., (*1)

Use Jank Profiler to wrap individual objects in your application to track memory usage and execution time of method calls belonging to that objects public api., (*2)

Usage

Let's say you have some code in your application that looks like this:, (*3)

$myQuestionableObject = new WhompWhompDoDad(['thinger_option_x' => true]);
$whompTimes = 3;
$myQuestionableObject->whomp($whompTimes);
$myQuestionableObjecct->doDad();

you can jank profile the WhompWhompDoDad instance like this:, (*4)

$myQuestionableObject = new JankProfiler('WhompWhompDoDad', [['thinger_option_x' => true]]);
$whompTimes = 3;
$myQuestionableObject->whomp($whompTimes);
$myQuestionableObjecct->doDad();

echo $myQuestionableObject->report('json') . "\n"; exit;

This will produce JSON output similar to:, (*5)

[
    {
        "type": "construct",
        "meta": {
            "classname": "WhompWhompDoDad",
            "constructor_args": [
                {
                    "thinger_option_x":  true
                }
            ]
        },
        "memory_before": 464280,
        "start_time": 1425158122.1155,
        "memory_after": 477968,
        "end_time": 1425158122.116
    },
    {
        "type": "method call",
        "meta": {
            "method": "whomp",
            "arguments": [
                3
            ]
        },
        "start_time": 1425158122.116,
        "memory_before": 479896,
        "end_time": 1425158122.116,
        "memory_after": 480312
    },
    {
        "type": "method call",
        "meta": {
            "method": "doDad",
            "arguments": []
        },
        "start_time": 1425158122.116,
        "memory_before": 481976,
        "end_time": 1425158122.116,
        "memory_after": 482344
    }
]

Pretty neat!, (*6)

Author

Colin DeCarlo, colin@thedecarlos.ca, (*7)

License

Jank Profiler is licensed under the MIT License - see the LICENSE file for details, (*8)

The Versions

07/03 2015

dev-master

9999999-dev

A profiler for when you don't want to figure out profilers.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

profile yolo jank

07/03 2015

0.2.0

0.2.0.0

A profiler for when you don't want to figure out profilers.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

profile yolo jank

01/03 2015

0.1.1

0.1.1.0

A profiler for when you don't want to figure out profilers.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

profile yolo jank

28/02 2015

0.1.0

0.1.0.0

A profiler for when you don't want to figure out profilers.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

profile yolo jank