The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Devel::NYTProf::Callgrind::Ticks - Represents a mesh of Ticks read from a callgrind file

DESCRIPTION

This class is mainly for TicksDiff but you can also use it alone to load and save callgrind files.

With this class you may find via getBlockEquivalent() the same callgrind block in a file by using a different callgrind file as reference to compare the values.

Or you want to manipulate callgrind files by changing values or adding blocks. If you plan to write any kind of ticks analysis this class might be helpull. Then maybe getBlocksAsArray() is usefull.

REQUIRES

Moose

METHODS

new

 $this->new();

BUILD

 $this->BUILD();

addBlock

 $this->addBlock(\%$block);

Adds a block. For example you start with an empty object and wants to add blocks from a different object. It will replace an existing block if the definition existists already. So addBlock can also be used to update a block. If you update an existing block, it does break the reference to the given hashref, it makes a copy of the values. So do not use the original hash then but use the method of this class to get the callgrind text.

getAsText

 my $text = $this->getAsText();

Returns the callgrind text

getBlockEquivalent

 my \%block = $this->getBlockEquivalent(\%block);

returns the equivalent block in that object to a given strange block (from a different object). Returns undef if not found.

getBlocksAsArray

 my \@list = $this->getBlocksAsArray();

Is the same as list(). It returns an ArrayRef of the blocks (HashRefs).

loadFile

 $this->loadFile($filename);

Loads the callgrind file into memory and starts internal indexing of the blocks.

saveFile

 $this->saveFile($filename);

Save the data to a callgrind file. The event type will be 'Ticks', nothing else.

LICENCE

You can redistribute it and/or modify it under the conditions of LGPL and Artistic Licence.

AUTHOR

Andreas Hernitscheck - ahernit AT cpan.org