#!/bin/sh  
# \
exec oagtclsh "$0" "$@"

#
# $Log: not supported by cvs2svn $
# Revision 1.1  1997/01/23 00:05:58  borland
# First version of script to plot data created by sddsDiskUsage.
#
# 

set auto_path [linsert $auto_path 0  /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]
APSStandardSetup

set tmpFile0 /tmp/[APSTmpString]
catch {exec sddsconvert -recover diskUsage.sdds -pipe=out \
    | sddsprocess -match=column,DirectoryName=kludge,! -pipe=in $tmpFile0 \
    -filter=param,Time,1e8,1e10 }

catch {exec sddsprocess $tmpFile0 -define=param,Page,i_page,type=long -pipe=out \
          -nowarning \
         | sddscollapse -pipe \
         | sddsprocess -pipe -process=Page,max,PageMax \
         | sdds2stream -pipe -parameter=PageMax} PageMax
catch {exec sddsprocess $tmpFile0 -pipe=out -nowarning \
         "-test=param,i_page $PageMax 1 - ==" \
         | sddssort -pipe  -column=DirectoryName \
         | sdds2stream -pipe -column=DirectoryName} DirectoryList

set tmpFile /tmp/[APSTmpString]
catch {exec sddsprocess $tmpFile0 -define=column,Time0,Time \
    $tmpFile}
exec rm $tmpFile0
set optionList ""
foreach elem $DirectoryList  {
    lappend optionList -column=Time0,SpaceUsed \
      -match=column,DirectoryName=$elem -title=$elem
}
eval exec sddsplot $tmpFile -separate -sameScales=global -ticks=xtime $optionList &
