NAME

DashProfiler::Sample - encapsulates the acquisition of a single sample

DESCRIPTION

A DashProfiler::Sample object is returned from the prepare() method of DashProfiler::Core, or from the functions imported by DashProfiler::Import.

The object, and this class, are rarely used directly.

METHODS

new

$sample = DashProfiler::Sample->new($meta, $context2);
$sample = DashProfiler::Sample->new($meta, $context2, $start_time);

The returned object encapsulates the time of its creation and some related meta data, such as the context2.

DESTROY

When the object is destroyed it:

- calls dbi_time() to get the time of the end of the sample
- marks the profile as no longer 'in use'
- adds the timespan of the sample to the 'period_accumulated' of the stash
- determines the value of C<context2>
- calls DBI::Profile::dbi_profile() for each profile attached to the stash