Run3/ProfArrayBuffer.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 96.9% 32 / 33 CC 2 SCAR 2.6
CC
2
Cov
96%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Run3/ProfPP.pm ↑ Summary
1 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package IPC::Run3::ProfArrayBuffer;
4  
5 3 our $VERSION = 0.049;
6  
7 =head1 NAME
8  
9 IPC::Run3::ProfArrayBuffer - Store profile events in RAM in an array
10  
11 =head1 SYNOPSIS
12  
13 =head1 DESCRIPTION
14  
15 =head1 METHODS
16  
17 =over
18  
19 =item C<< IPC::Run3::ProfArrayBuffer->new() >>
20  
21 =cut
22  
23 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
24 3 ▶ my $class = ref $_[0] ? ref shift : shift;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 3 3
25  
26 3 my $self = bless { @_ }, $class;
27  
28 3 $self->{Events} = [];
29  
30 3 return $self;
31 }
32  
33 =item C<< $buffer->app_call(@events) >>
34  
35 =item C<< $buffer->app_exit(@events) >>
36  
37 =item C<< $buffer->run_exit(@events) >>
38  
39 The three above methods push the given events onto the stack of recorded
40 events.
41  
42 =cut
43  
44 3 for my $subname ( qw(app_call app_exit run_exit) ) {
45 3 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
46 9 ▶ *{$subname} = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
47 7 push @{shift->{Events}}, [ $subname => @_ ];
48 9 };
49 }
50  
51 =item get_events
52  
53 Returns a list of all the events. Each event is an ARRAY reference
54 like:
55  
56 [ "app_call", 1.1, ... ];
57  
58 =cut
59  
60 5 ▶sub get_events {
Subroutine get_events: called CC=1 SCAR=0.0
Pod documented
61 5 my $self = shift;
62 5 @{$self->{Events}};
63 }
64  
65 =back
66  
67 =head1 LIMITATIONS
68  
69 =head1 COPYRIGHT
70  
71 Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved
72  
73 =head1 LICENSE
74  
75 You may use this module under the terms of the BSD, Artistic, or GPL licenses,
76 any version.
77  
78 =head1 AUTHOR
79  
80 Barrie Slaymaker E<lt>barries@slaysys.comE<gt>
81  
82 =cut
83  
84 3 1;
« Run3/ProfPP.pm ↑ Summary