Last active
October 29, 2019 09:25
-
-
Save fridge/328d986b40d847b933e8f7586ba068e8 to your computer and use it in GitHub Desktop.
tideways
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$profiling = true; | |
if ($profiling && extension_loaded('tideways')) { | |
tideways_enable(TIDEWAYS_FLAGS_NO_SPANS + TIDEWAYS_FLAGS_CPU + TIDEWAYS_FLAGS_MEMORY); | |
} | |
if ($profiling && extension_loaded('tideways')) { | |
$data = tideways_disable(); | |
$namespace = str_replace('.', '-', $_SERVER['HTTP_HOST']); | |
$result = file_put_contents( | |
_DIR_ . "/runs/" . uniqid() . " . $namespace.xhprof", | |
serialize($data) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment