As shipped, ClearDDTS includes all of the source programs for the management reports so that these source programs can be modified to suit your needs. If you want to report additional information or produce custom reports, working examples are available to use as a starting point.
The following topics are covered:
To integrate a report into the xddts and webddts interfaces it must appear in the report_conf file. A copy of this file is shown below:
# report_conf # # This file drives the ClearDDTS reporting mechanism - note that the '#' # character indicates a comment and all text from that character # to the end of the line will be ignored. # # a line ending with a '\' character will be considered to continue # on the next line. Each Report configuration line consists of three # fields separated by the ':' character. Each line looks like # # attributes : Report Label Text : report command string # # R E P O R T A T T R I B U T E S # # -ascii - the report's output is in ASCII format # -ps - the report's output is in PostScript format # -troff - the report's output is in Troff format # -notty - the report should not be sent to a tty device. # -gif - the report's output is in gif when run from the web # -html - the report's output is in html when run from the web # # R E P O R T L A B E L T E X T # # The report label text is displayed in the list of available reports. # # R E P O R T C O M M A N D S T R I N G # # The report command string is essentially a command similar to a string # that would be passed to the system (3) call. There are several # variables that are understood and interpreted by the reporting mechanism. # They are as follows. # # $start - start of date range for the reporting period # $end - end of date range for the reporting period # $projects - list of projects to be passed to report script # $states - states argument to be passed to report script # $color - Tells report script whether or not to generate # color output. # # -ascii : Table of Problems by Project by State.:\ dawk01.sh $start $end $states $projects # an appended comment -ascii : Table of Problems by Project by Severity.:\ dawk02.sh $start $end $states $projects -ascii : Table of Problems by Assigned Engineer by Severity.:\ dawk03.sh $start $end $states $projects -ascii : Table of Problems by Assigned Engineer by State.:\ dawk04.sh $start $end $states $projects -ascii : Table of Problems by Submitter by Severity.:\ dawk05.sh $start $end $states $projects -ascii : Table of Problem Arrival and Repair Rates.:\ dawk06a.sh -b $start $end $states $projects -ascii : Three Line Summary of all Problems.:\ dawk07.sh $start $end $states $projects -ascii : General Problem Statistics.:\ dawk08.sh $start $end $states $projects -ascii : Report of Problems Submitted Over the Last Week.:\ wsubmit.sh $states $projects -ascii : Report of Problems Resolved Over the Last Week.:\ wresolve.sh $states $projects -ascii : Full Text Listing of Queried Problems.:\ wdump.sh -ps -notty -gif : Graph of Phase Metrics.:\ dgawk01.sh $color -b $start $end $states $projects -troff : Phase Containment Effectiveness Report.:\ dgawk02.sh -b $start $end $states $projects -ps -notty -gif : Phase Containment Effectiveness Bar Graph. :\ dgawk11.sh $color -b 1 $start $end $states $projects -ps -notty -gif : Total Faults Sourced Per Phase. :\ dgawk11.sh $color -b 2 $start $end $states $projects -ps -notty -gif : Graph of Problems by Resolution Type.:\ dgawk03.sh $color -b $start $end $states $projects -ps -notty -gif : Graph of Submitters, Assigned Engineers, and Resolvers.:\ dgawk05.sh $color -b $start $end $states $projects -ps -notty -gif : Graphs - Problems by Severity, Problems by State, Problem Arrival Rate.:\ dawk06.sh $color -b $start $end $states $projects -ps -notty -gif : Graph of Problems by Severity.:\ dgawk07.sh $color -b $start $end $states $projects -ps -notty -gif : Graph - Repair Time & Diff Between Est & Actual Fix Time.:\ dgawk08.sh $color -b $start $end $states $projects -ps -notty -gif : Graph of Overdue Problems. :\ dgawk09.sh $color -b $start $end $states $projects -troff -notty : One Line Meeting Summary of Selected Problems.:\ dgawk10.sh -b $start $end $states $projects
There is a separate report_conf file for every class.
Each dawknn.sh or dgawknn.sh file is a shell script that runs the corresponding dawk/dgawk report script. Most of these shell scripts are similar except for the name of the awk script that they invoke.
How each interface uses these scripts to produce
reports is detailed below.
dgawk07.sh $color -b $start $end $states $projects
cd ~ddts/bin cp dawk02.sh dawk22.sh
A portion of a defect record file is shown below. Note that these files always begin with the "Start: bug-ID" field and end with the "End: bug-ID" field.
Start: CMMaa000135 Project: DDT.bugs Engineer: mike Submitted-on: 880606 Headline: The clinit(3) routine dumps core in diagnostic mode Severity: 2 Status: N . . . End: CMMaa000135The defect records were designed to make writing awk scripts easy. For example, look at dawk07, a portion of which is shown below:
/^Severity:/ { severity = $2 next } /^Status:/ { status = $2 next } /^Headline/ { for(i = 2; i <= NF; ++i) headline = headline $i " " next } . . . { printf "\nBug Number = %s\n",xstart. . . printf "St=%s, Sv=%s, %-65.65s\nModule: %s, . . . }This script produces three-line bug summaries. If you already know how to write awk scripts, writing scripts for the ClearDDTS defect record format is very easy. If you are not familiar with awk scripts, there are numerous sample scripts to start with.
Since multiple gifs can be generated, the gifs need to be created in a certain way so that webddts knows how and where to view them:
if [ "$DDTS_GRAPH_FORMAT" = "gif" ]; then gifbug < tmp/dg5tmp1.$$ >$home/www/$DDTS_GRAPH_BASE.01.gif 2>$home/www/$DDTS_GRAPH_BASE.01.err.txt gifbug < tmp/dg5tmp2.$$ >$home/www/$DDTS_GRAPH_BASE.02.gif 2>$home/www/$DDTS_GRAPH_BASE.02.err.txt gifbug < tmp/dg5tmp3.$$ >$home/www/$DDTS_GRAPH_BASE.03.gif 2>$home/www/$DDTS_GRAPH_BASE.03.err.txt gifbug < tmp/dg5tmp4.$$ >$home/www/$DDTS_GRAPH_BASE.04.gif 2>$home/www/$DDTS_GRAPH_BASE.04.err.txt echo "$Title1" > $home/www/$DDTS_GRAPH_BASE.00.desc echo "$Title2" >> $home/www/$DDTS_GRAPH_BASE.00.desc echo "$Title3" >> $home/www/$DDTS_GRAPH_BASE.00.desc echo "$Title4" >> $home/www/$DDTS_GRAPH_BASE.00.desc rm -f tmp/dg5tmp1.$$ tmp/dg5tmp2.$$ tmp/dg5tmp3.$$ tmp/dg5tmp4.$$ exit 0 else graphbug $colorflg < tmp/dg5tmp1.$$ > $home/tmp/ps.dg5awk1.$$ graphbug $colorflg < tmp/dg5tmp2.$$ > $home/tmp/ps.dg5awk2.$$ graphbug $colorflg < tmp/dg5tmp3.$$ > $home/tmp/ps.dg5awk3.$$ graphbug $colorflg < tmp/dg5tmp4.$$ > $home/tmp/ps.dg5awk4.$$ fiThis code snippet shows that gifbug is called in much the same way as graphbug, but the output filename has changed.
In the case of multiple gifs, each gif should be directed into its own sequentially numbered file. Furthermore, the description file contains one title per line. Webddts associates the first line of this file with "01.gif", the second line with "02.gif" and so on. When the report is complete, webddts lists them something like:
This clarifies what each gif will display when you click on the link. Be sure that the description file is numbered "00" so that it sorts before the other gif files, otherwise it will not get picked up._Page 01_ Problems by state _Page 02_ Problems by severity _Page 03_ Problems by engineer _Page 04_ Problems by phase
You can customize the gif display sizes available
in the webddts interface and set the default value (640x480 as shipped).
To do this edit the ~ddts/class/<class>/web_conf file. You can
also customize the number of x-axis and y-axis labels and ticks through
the web_conf file.
DDTS_THCOLOR # table header color, for html reports DDTS_BGCOLOR # page background color, for html reports DDTS_TEXTCOLOR # text color, for html reportsIncluding these environment variables keeps the report visually continuous with the rest of the web interface.
You can also provide links to defects in the report by building URLs such as:
<a href=$DDTS_WEBPROG?REMOTE_USER=$DDTS_REMOTE_USER&NextForm=DumpBug&bug_id=$bug_id>where $bug_id is a defect identifier that you have calculated. This URL displays only the defect record, not the full frames mode of webddts. To get the full frames mode, specify id=$bug_id instead of bug_id=$bug_id.
If there is a whole list of defects, you can display them in a new window by specifying a target in the URL.
Note that the reports being invoked in the default report_conf file are the dawknn.sh shell scripts. Reports you add can also be awk scripts or any other type you have created that will produce the expected output.
To add your dawk22.sh report from the previous example to the report_conf file, you would add something like the following:
-ascii: This is the foo report: dawk22.sh $states $projects