AppsDBA Resource Profiler Installation
These guidelines are meant to help get you started running the AppsDBA Resource Profiler. Since the profiler is written in perl, you have to have a perl environment to run it in. This can be your Windows machine or a Linux box, or anything that can run perl. I've included some tips for running cygwin on Windows, and the manual package installation instructions are valid for installing any perl package by hand. Packages not included with Perl or the cygwin installation can be found on CPAN.org.
Required Perl Modules
The following modules are required to run the resource_event.pl script:
POSIX - for the "ceil" call
and if the CSV option is not chosen then
are required for the Event Timeline graph.
Using cygwin To Run resource_event.pl In Perl
Since the new version of cygwin has been released I've found that installing all of the requirements to run the resource_event.pl script can be a bit tricky. Cygwin can be found at www.cygwin.com. I recommend first installing cygwin and then install the following packages:
Manual Package Installation
Once cygwin is installed then the additional packages for resource_event.pl must be installed manually. To install packages manually the following commands must be run for each package in that package's directory:
The following packages are required:
If strange errors occur when installing these packages, like trying to find the perl executable, then it may be necessary to rebaseline cygwin. This can be done by running the following in the "run" dialog from the Start menu in Windows: c:\cygwin\bin\ash '/bin/rebaseall'.
Using Excel 2007 Create The Event Timeline
The Resource Event Timeline script can create the event time line using the perl GD packages (i.e. GDTextUtil, GD, GDGraph) or it can create a comma separated values (CSV) text file that can be used to create the time line using some other graphing tool. The following will describe how to create the event timeline using a stacked bar chart in Excel 2007. The CSV output option in the Resource Event Timeline script should be chosen. This will create a .txt file with the trace name appended with "_csv.txt". The file is actually delimited with "#" symbols instead of actual commas. The first column is the interval number, which can be ignored in creating the chart, the second column is the trace file interval tim= value, the third column is an event name and the fourth column is that event's total time for the interval.
To create the event timeline chart in Excel 2007, the PivotChart feature will need to be used. The first step is to load the csv file created from the resource_event.pl program into Excel by opening the file from within Excel. This will invoke the "Text Import Wizard". In Step 1 the "Delimited" option should be chosen and then the "Next >" button. In the second screen the "Other:" option should be checked and a "#" symbol added to the box directly to the right of the option. The "Finish" button can then be chosen. You should now have the file in a new Excel sheet.
The next step is to format the "B" column which are the "tim=" values. Left click the "B" label and this should highlight the column, then right click and choose the "Format Cells …" option. Click on "Number" and then set "Decimal places:" to zero and click the "OK" button. This should cause Excel to display the full "tim=" values rather than the scientific notation format. Next highlight all of the values in columns B, C and D and choose the "Insert" tab. Pull down on the PivotTable option and choose PivotChart. A "Create PivotTable with PivotChart" dialog box should appear. The "Select a table or range" option should be set with a range and the "New Worksheet" option should also be set. Click on the "OK" button.
Now we can create our PivotChart. In the "PivotTable Field List" box to the right select each option. The first field will be the "Axis Fields" (simply drag it from the "Values" box), the second field should be placed in the "Legend Fields …" box and the third field will be the "Values" box. At this point I recommend that you sort the columns in descending order by Grand Total. I find this makes the timeline more readable. To do this highlight the "Grand Total" row starting with the first event column, which should be column B. Just select the values in the "Grand Total" row. Do not include the last column which is the "Grand Total" of all of the column totals. Next click the "Data" tab at the top of the sheet and choose the "Sort" option. A "Sort By Value" box will appear, choose "Largest to Smallest" and click the "OK" option. The columns should now be in descending order with the "tim=" value column still in the first column. The last step is to convert the chart to a stacked bar chart. To do this right click in the chart and choose "Change Chart Type …" and then choose the "Stacked Column" (this is the second box in the first row). Then click the "OK" box. You can now drag the chart to another area in the sheet or cut and paste it into a new sheet.