Changeset 254

Show
Ignore:
Timestamp:
09/18/01 08:38:55
Author:
miyagawa
Message:

0.02

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Attribute-Profiled/trunk/Changes

    r234 r254  
    11Revision history for Perl extension Attribute::Profiled. 
     2 
     30.02  Tue Sep 18 08:39:12 JST 2001 
     4        - fixed return value bug, added test suite 
     5        - docs update 
    26 
    370.01  Sun Sep  2 02:23:01 2001 
  • Attribute-Profiled/trunk/README

    r234 r254  
    1 Attribute/Profiled version 0.01 
    2 =============================== 
     1NAME 
     2    Attribute::Profiled - Profiles specific methods in class 
    33 
    4 The README is used to introduce the module and provide instructions on 
    5 how to install the module, any machine dependencies it may have (for 
    6 example C compilers and installed libraries) and any other information 
    7 that should be provided before the module is installed. 
     4SYNOPSIS 
     5      package SomeClass; 
     6      use Attribute::Profiled; 
    87 
    9 A README file is required for CPAN modules since CPAN extracts the 
    10 README file from a module distribution so that people browsing the 
    11 archive can use it get an idea of the modules uses. It is usually a 
    12 good idea to provide version information here so that people can 
    13 decide whether fixes for the module are worth downloading. 
     8      sub long_running_method : Profiled { } 
    149 
    15 INSTALLATION 
     10DESCRIPTION 
     11    Attribute::Profiled provides a way to profile specific methods with 
     12    attributes. This module uses Benchmark::Timer to profile elapsed times 
     13    for your calls to the methods with Profiled attribute on. 
    1614 
    17 To install this module type the following: 
     15    Profiling report will be printed to STDERR at the end of program 
     16    execution. 
    1817 
    19    perl Makefile.PL 
    20    make 
    21    make test 
    22    make install 
     18TODO 
     19    *   Options where to print profiling report. 
    2320 
    24 DEPENDENCIES 
     21    *   Allows public way to get reports in any timing other than the end of 
     22        execution. Currently you can do it by explicitly calling report() on 
     23        $Attribute::Profiled::_Profiler. 
    2524 
    26 This module requires these other modules and libraries: 
     25AUTHOR 
     26    Tatsuhiko Miyagawa <miyagawa@bulknews.net> 
    2727 
    28   blah blah blah 
     28    This library is free software; you can redistribute it and/or modify it 
     29    under the same terms as Perl itself. 
    2930 
    30 COPYRIGHT AND LICENCE 
     31SEE ALSO 
     32    the Attribute::Handlers manpage, the Benchmark::Timer manpage 
    3133 
    32 Put the correct copyright and licence information here. 
    33  
    34 Copyright (C) 2001 A. U. Thor blah blah blah 
    35  
  • Attribute-Profiled/trunk/lib/Attribute/Profiled.pm

    r234 r254  
    55use warnings; 
    66 
    7 our $VERSION = '0.01'; 
     7our $VERSION = '0.02'; 
    88 
    99use Attribute::Handlers; 
     
    2323        my @ret = wantarray ? $referent->(@_) : scalar $referent->(@_); 
    2424        $_Profiler->stop("$package\::$meth"); 
    25         return @ret
     25        return wantarray ? @ret : $ret[0]
    2626    }; 
    2727} 
     
    7373C<$Attribute::Profiled::_Profiler>. 
    7474 
     75=item * 
     76 
     77Currently it's not caller sensitive (doesn't use goto). 
     78 
    7579=back 
    7680 
  • Attribute-Profiled/trunk/t/00_Profiled.t

    r234 r254  
    2929sub method : Profiled { 
    3030    my $self = shift; 
    31     return 1
     31    return 'foo'
    3232} 
    3333 
     
    4242 
    4343my $foo = SomeClass->new; 
    44 is($foo->method, 1, 'retvalue preserved'); 
     44is($foo->method, 'foo', 'retvalue preserved'); 
    4545 
    4646$foo->method for (1..10);