Run3/ProfArrayBuffer.pm

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