PHP code example of performance-x / xhprof-data-processor

1. Go to this page and download the library: Download performance-x/xhprof-data-processor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

performance-x / xhprof-data-processor example snippets


use PerformanceX\XHProfProcessor\XHProfDataProcessor;

$processor = new XHProfDataProcessor();
$processed_data = $processor->process($xhprof_data);

[
    "main()" => [
        "ct" => 1,
        "wt" => 100
    ],
    "SomeClass::method==>strlen" => [
        "ct" => 1,
        "wt" => 50
    ]
]

[
    "main()" => [
        "ct" => 1,
        "wt" => 100
    ],
    "SomeClass::method(User $user, array $data)==>strlen(string $string)" => [
        "ct" => 1,
        "wt" => 50
    ]
]