Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:11

0001 #!/bin/bash
0002 
0003 echo -e "\nverifyFrontier 1.4 - 2007, by Pietro M. Picca <Pietro.Picca@cern.ch>\n"
0004 if [ $# -lt 1 ]
0005 then
0006   echo "Please specify the configuration file name on the command line."
0007   echo -e "Syntax: ${0} filename.cfg\n"
0008   exit 1
0009 fi
0010 export FRONTIER_LOG_LEVEL=debug
0011 export FRONTIER_LOG_FILE=${1%%.cfg}.log
0012 export FRONTIER_LOG_FILE=./${FRONTIER_LOG_FILE##*/}
0013 if [ ! -r ${1} ]
0014 then
0015   echo -e "The file ${1} does not exist.\n"
0016   exit 2
0017 fi
0018 rm ${FRONTIER_LOG_FILE} >& /dev/null
0019 echo "Please wait while processing ${1} file. It could take several minutes..."
0020 eval `scramv1 runtime -sh`
0021 cmsRun ${1} >& /dev/null
0022 if [ -s ${FRONTIER_LOG_FILE} ]
0023 then
0024   echo "List of Frontier databases, accounts and payloads involved while processing ${1} file:" >& ${FRONTIER_LOG_FILE%%.log}.sum
0025   gawk 'BEGIN {
0026           sep = " - "
0027           maxl = 0
0028           nqueries = 0
0029         }
0030         /GET/ {
0031           dbname = gensub(/.*:8000\/([^/]+)\/.*/, "\\1", "g")
0032         }
0033         /SELECT \"TOKEN\"/ {
0034           leaf = "Database name: " dbname sep gensub(/.*FROM \"([^"]+)\".* = .(.*).$/, "Account: \\1" sep "Payload: \\2", "g")
0035           leaves[leaf] = leaf
0036           l = length(gensub(/.* - (.*) - .*$/, "\\1", "g", leaf))
0037           if (l > maxl) maxl = l
0038         }
0039         /encoding request/ {
0040           nqueries++
0041         }
0042         END {
0043           prev = ""
0044           for (i = 1; i <= asort(leaves); i++) {
0045             split(leaves[i], items, sep)
0046             if (prev != items[1]) {
0047               print "\n" items[1]
0048               prev = items[1]
0049             }
0050             printf "%-" maxl "s      %s\n", items[2], items[3]
0051           }
0052           print "\nTotal number of queries: " nqueries
0053         }' ${FRONTIER_LOG_FILE} >> ${FRONTIER_LOG_FILE%%.log}.sum
0054   gawk -v i=0 '{ if (i++ > 0) print }' ${FRONTIER_LOG_FILE%%.log}.sum
0055   echo
0056 else
0057   echo -e "The file ${1} is not set to use Frontier.\n"
0058   exit 3
0059 fi
0060 rm ${FRONTIER_LOG_FILE} >& /dev/null