Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it causes build failure.
- Loading branch information
Showing
1 changed file
with
118 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
=begin pod | ||
=TITLE class Telemetry::Period | ||
=SUBTITLE Performance data over a period | ||
class Telemetry::Period { } | ||
A C<Telemetry::Period> object contains the difference between two C<Telemetry> | ||
objects. It is generally not created by calling .new, but it can be if needed: | ||
it takes "cpu-user", "cpu-sys" and "wallclock" as named parameters. | ||
=begin code | ||
# basic usage | ||
use Telemetry; | ||
my $t0 = Telemetry.new; | ||
# execute some code | ||
my $t1 = Telemetry.new; | ||
my $period = $t1 - $t0; # creates Telemetry::Period object | ||
say "Code took $period (cpu / wallclock) microseconds to execute"; | ||
=end code | ||
=head2 Data Methods | ||
=item method affinity-tasks-completed | ||
The number of tasks completed in affinity threads in this period. | ||
=item method affinity-tasks-queued | ||
The number of tasks queued for execution in affinity threads in this period. | ||
=item method affinity-workers | ||
The number of affinity threads added in this period. | ||
=item method cpu | ||
Returns the total amount of CPU time of this period (in microseconds), | ||
essentially the sum of C<cpu-user> and C<cpu-sys>. | ||
=item method cpus | ||
Returns the number of CPUs that were in full use on average in this period | ||
(basically L<cpu> divided by L<wallclock>). | ||
=item method cpu-user | ||
Returns the amount of CPU time spent on executing user code of this period | ||
(in microseconds). | ||
=item method cpu-sys | ||
Returns the amount of CPU time spent in system overhead of this period (in | ||
microseconds). | ||
=item method general-tasks-completed | ||
The number of tasks completed in general worker threads in this period. | ||
=item method general-tasks-queued | ||
The number of tasks queued for execution in general worker threads in this period. | ||
=item method general-workers | ||
The number of general worker threads that were added in this period. | ||
=item method max-rss | ||
Maximum resident set size increase for this period (in Kbytes). | ||
=item method supervisor | ||
The number of supervisor threads added in this period. | ||
=item method timer-tasks-completed | ||
The number of tasks completed in timer worker threads in this period. | ||
=item method timer-tasks-queued | ||
The number of tasks queued for execution in timer worker threads in this period. | ||
=item method timer-workers | ||
The number of timer worker threads that were added in this period. | ||
=item method utilization | ||
Returns the % of CPUs that were used on average in this period. | ||
=item method wallclock | ||
Returns the length of the period (in microseconds). | ||
Apart from these data methods, other fields in the POSIX C<getrusage> struct | ||
are also available, but are probably not in use on most operating systems and | ||
will thus always give 0. These are: | ||
id-rss, inblock, invcw, is-rss, ix-rss, maj-flt, min-flt, msgrcv, msgsnd, | ||
nsignals, nswap, nvcsw, outblock. | ||
Please consult the C<getrusage> manual information for the meaning of these | ||
fields. | ||
=head1 Other methods | ||
=head2 method gist / method Str | ||
Returns a string representation in the form "cpu / wallclock". | ||
=head1 See Also | ||
L<Telemetry> | ||
L<snapper> | ||
=end pod |