r2 - 28 Dec 2004 - 16:05:09 - MikeTYou are here: OSAF >  Journal Web  >  TWikiUsers > MikeT > MikeTaylorNotes > MikeTaylor20041227

Performance Data Collection

Heikki asked me to start implementing the changes to the tinderbox scripts that we talked about earlier and here are some notes on what will be done.

First the main tinderbox processing script needs to be modified. Tinderbox 2 uses a perl script (processmail_builds) that is called by the mail daemon whenever a new message has arrived from one of the tinderbox clients. This script performs a number of data manipulations and also extracts various items from the mail message - the gory details can be found by reading the script, it's pretty accurately documented.

The change I introduced was basically to look for a regex hit and when found, store the line to a data file -- a very common pattern in Tinderbox processing. The core part of the routine is as follows:

    if ($TINDERBOX{'status'} eq 'success') {
        open(PERF, ">$TMP_FILE{'perf-log'}") ||
            die("Could not write to file: '$TMP_FILE{'perf-log'}'.$!\n");
      
      ($PSecond, $PMinute, $PHour, $PDay, $PMonth, $PYear, $PWeekDay, $PDayOfYear, $PIsDST) = gmtime($TINDERBOX{'starttime'});

      $PDate = sprintf("%04d%02d%02d", $PYear + 1900, $PMonth + 1, $PDay);
      $PTime = sprintf("%02d%02d%02d", $PHour, $PMinute, $PSecond);
    }

  ... snip ...

    if (($TINDERBOX{'status'} eq 'success') &&
        ($line =~ m/\s*OSAF_QA\s*:\s*(.*)/)) {
        my $print = $1;

        print PERF $TINDERBOX{'tree'},"|",$TINDERBOX{'buildname'},"|",$PDate,"|",$PTime,"|",$print,"\n";
        next;
    }

yep, it's a basic check to see if the current line matches our regex, and if so output it to our performance file. All the fun stuff happens in the python script that reads the raw dump and generates basic html data.

One of the things that has to be decided upon is the structure of what follows the OSAF_QA: marker - in my earlier testing I was using this format:

  BuildName | DateRun | UniqueName | StartTime | EndTime | Cumulative

The

BuildName
and
DateRun
items can be extracted from the tinderbox data and most likely all that is really needed is the Cumulative value, so what the timing test code needs to output boils down to:

  OSAF_QA: UniqueName | Cumulative


I updated the above code to reflect the addition of the hard-coded output. The above code generates the following information:

Chandler|oahu-linux|20040828|001050|test line : foo, bar, baz - lalalala

using this input line:

OSAF_QA : test line : foo, bar, baz - lalalala

Another change that I made was to format the time information into something a bit more readable (and also parseable), split it into date and time portions and also wrapped the code with a check to see if the status = 'success'. This way only performance data from successful runs are processed and stored.

-- MikeT - 28 Dec 2004

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.