perf script

This script displays genxref's performance statistics for the various versions of the tree.

duration ($start, $end)

Function duration returns a human-readable string for the time difference between its arguments.

  1. $start

    an integer containing the number of seconds since the epoch for the beginning of the interval

  2. $end

    an integer containing the number of seconds since the epoch for the end of the interval

If the end date is negative, an error occurred during the interval.

If the start date is negative, the step was skipped.

rowclass ($templ, $line)

Function rowclass is the "$variable" substitution function for lineclass. It returns a CSS class name depending on line parity.

  1. $templ

    a string containing the template (empty for a "variable")

  2. $line

    an integer containing the line number of the display

onelineexpand ($temp, $reindex, @versions)

Function onelineexpand is a "$function" substitution function. It returns its template expanded for every line matching its second argument.

  1. $templ

    a string containing the template

  2. $reindex

    the full reindex flag as 0 or 1 to select the proper values

  3. @versions

    an array containing the versions (release-ids) for which performance data must be edited.

It fetches performance data for the elements of its second argument.

perfdataexpand ($templ, $reindex)

Function perfdataexpand is a "$function" substitution function for perffull. It returns its template argument expanded for every line in the DB selection.

  1. $templ

    a string containing the template

  2. $reindex

    the full reindex flag as 0 or 1 to select the proper values

It fetches versions involved in purgeing indexations.

The "line" is expanded by a common procedure.

perffpurgeexpand ($templ)

Function perffpurgeexpand is a "$function" substitution function for perffullpurge. It returns its template argument expanded for the line corresponding to a full purge (column releaseid is a null string).

  1. $templ

    a string containing the template

It fetches the null version used to store full purge timing.

The "line" is expanded by a common procedure.

getserial () and getelapsed ()

These helper functions work around random adverse effect caused by a possible optimisation in mod_perl. Transferring correct computed value of $totalserialtime or $totalelapsed to anonymous subs requires late binding. It looks like sometimes early binding is used, leading to the variables initial value instead of fetching the current value.

Replacing reference to the variables by a function seems to cure the problem.

Script entry point

Selects the correct header and footer, retrieves the 'htmlperf' template and launches template expansion.

The script does not use any query argument, however they are managed as usual which allows to switch to other scripts with variables set as desired.