Methods |
public
|
__construct()
Creates a new MetricCollector object
Creates a new MetricCollector object
Implements
|
#
|
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<T is string[]|string|null>(T $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<T is string[]|string|null>(
bool $includeRunning = true,
T $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.
|
|
#
|