11 from __future__
import print_function
16 """returns nfiles, fsize, nevents"""
17 stype, sep, sname = streamname.partition(
'_')
18 cursor.execute(
"SELECT SUM(NREVENTS),LUMIBLOCKNR,COUNT(FILESIZE),SUM(FILESIZE) FROM SFO_TZ_File WHERE RUNNR=:arg_1 and STREAMTYPE=:arg_2 and STREAM=:arg_3 GROUP BY LUMIBLOCKNR ORDER BY LUMIBLOCKNR",
19 arg_1=runno, arg_2=stype, arg_3=sname )
20 return cursor.fetchall()
23 cursor.execute(
"SELECT MIN(LUMIBLOCKNR), MAX(LUMIBLOCKNR) FROM SFO_TZ_Lumiblock WHERE RUNNR=:arg_1", arg_1=runno )
24 return cursor.fetchone()[0:2]
28 return cx_Oracle.connect(
"ATLAS_SFO_T0_R/readmesfotz2008@atlr")
32 print(
'Usage: %s [options]' % sys.argv[0])
33 print(
' -r | --run : run number (REQUIRED)')
34 print(
' -s | --stream : full stream name (REQUIRED)')
35 print(
' -h | --help : print this usage message')
43 longopts = [
"run=",
"stream=",
"help",
"usage"]
44 opts, args = getopt.getopt( sys.argv[1:], shortopts, longopts )
46 except getopt.GetoptError:
48 print(
'ERROR: unknown options in argument %s' % sys.argv[1:], file=sys.stderr)
54 if o
in (
"-?",
"-h",
"--help",
"--usage"):
56 elif o
in (
"-r",
"--run"):
58 elif o
in (
"-s",
"--stream"):
61 if not runno
or not stream:
usage()
65 cursor = connection.cursor()
67 print(
'Results for run: %i, stream: "%s"' % (runno, stream))
76 print(
'First non-zero LB: ' +
str(lblist[0][1]))
77 print(
'Last non-zero LB: ' +
str(lblist[-1][1]))
83 for (nev,lb,nfiles,fsize)
in lblist:
85 print(
' ... Run %i, LB %i has %i events, %i RAW files and %f MB' % (runno,lb,nev,nfiles,fsize))
89 print(
'--------------------------------------------------')
90 print(
'Total #events : ', sumnev)
91 print(
'Total #files : ', sumnfiles)
92 print(
'Total RAW size: ', sumfsize/1000.0,
' GB')
97 if __name__ ==
'__main__':