IPC::Run3::ProfArrayBuffer - Store profile events in RAM in an array


IPC-Run3 documentation Contained in the IPC-Run3 distribution.

Index


Code Index:

NAME

Top

IPC::Run3::ProfArrayBuffer - Store profile events in RAM in an array

SYNOPSIS

Top

DESCRIPTION

Top

METHODS

Top

IPC::Run3::ProfArrayBuffer->new()
$buffer->app_call(@events)
$buffer->app_exit(@events)
$buffer->run_exit(@events)

The three above methods push the given events onto the stack of recorded events.

get_events

Returns a list of all the events. Each event is an ARRAY reference like:

   [ "app_call", 1.1, ... ];

LIMITATIONS

Top

COPYRIGHT

Top

LICENSE

Top

You may use this module under the terms of the BSD, Artistic, or GPL licenses, any version.

AUTHOR

Top

Barrie Slaymaker <barries@slaysys.com>


IPC-Run3 documentation Contained in the IPC-Run3 distribution.
package IPC::Run3::ProfArrayBuffer;

$VERSION = 0.044;

use strict;

sub new {
    my $class = ref $_[0] ? ref shift : shift;

    my $self = bless { @_ }, $class;

    $self->{Events} = [];

    return $self;
}

for my $subname ( qw(app_call app_exit run_exit) ) {
  no strict 'refs';
  *{$subname} = sub {
      push @{shift->{Events}}, [ $subname => @_ ];
  };
}

sub get_events {
    my $self = shift;
    @{$self->{Events}};
}

1;