shish / eventtracer-php
An API to write JSON traces as used by the Chrome Trace Viewer
Installs: 16 897
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2024-10-31 00:17:18 UTC
README
$et = EventTracer("myeventlog.json");
$et->begin("Eating Cake");
[...]
$et->end();
If filename isn't specified, then data will be buffered
in-memory ($et->buffer
) and can be written to disk in
one go with $et->flush($filename)
.
Viewing Data:
Visit chrome://tracing
Load JSON file
Format Spec:
Uses the JSON Array Format because that's the one which can be appended to from multiple threads