Methods |
public
|
count(string $counter, string $group = 'general'): int
Increment a counter and return its value
Increment a counter and return its value
|
#
|
public
|
add(int $value, string $counter, string $group = 'general'): int
Add a value to a counter and return its value
Add a value to a counter and return its value
|
#
|
public
|
startTimer(string $timer, string $group = 'general'): void
Start a timer based on the system's high-resolution time
Start a timer based on the system's high-resolution time
|
#
|
public
|
stopTimer(string $timer, string $group = 'general'): float
Stop a timer and return the elapsed milliseconds
Stop a timer and return the elapsed milliseconds
|
#
|
public
|
push(): void
Push the current state of all metrics onto the stack
Push the current state of all metrics onto the stack
|
#
|
public
|
pop(): void
Pop metrics off the stack
Pop metrics off the stack
|
#
|
public
|
getCounter(string $counter, string $group = 'general'): int
Get the value of a counter
Get the value of a counter
|
#
|
public
|
getCounters(string[]|string|null $groups = null): array<string, array<string, int>>|array<string, int>
Get counter values
Get counter values
Returns an array that maps groups to counters:
[ <group> => [ <counter> => <value>, ... ], ... ]
Or, if $groups is a string:
[ <counter> => <value>, ... ]
Parameters
$groups |
If null or ["*"] , all counters
are returned, otherwise only counters in the given groups are returned.
|
|
#
|
public
|
getTimer(string $timer, string $group = 'general', bool $includeRunning = true): array{float, int}
Get the start count and elapsed milliseconds of a timer
Get the start count and elapsed milliseconds of a timer
|
#
|
public
|
getTimers(
bool $includeRunning = true,
string[]|string|null $groups = null,
): array<string, array<string, array{float, int}>>|array<string, array{float, int}>
Get timer start counts and elapsed milliseconds
Get timer start counts and elapsed milliseconds
Returns an array that maps groups to timers:
[ <group> => [ <timer> => [ <elapsed_ms>, <start_count> ], ... ], ... ]
Or, if $groups is a string:
[ <timer> => [ <elapsed_ms>, <start_count> ], ... ]
Parameters
$groups |
If null or ["*"] , all timers are
returned, otherwise only timers in the given groups are returned.
|
|
#
|
public
|
getMaxTimers(string[]|string|null $groups = null): array<string, int>|int
Get the maximum number of timers running simultaneously
Get the maximum number of timers running simultaneously
Parameters
$groups |
If null or ["*"] , values are
returned for all groups, otherwise only values for the given groups are
returned.
|
|
#
|