122 import xmlrpclib, time
123 s = xmlrpclib.ServerProxy(
'http://atlasdqm.cern.ch:8080')
124 print "Writing HTML index file..."
125 f =
open(indexFile,
'w')
126 f.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
127 f.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
129 f.write(
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
130 f.write(
'<title>ATLAS Data-Quality Monitoring: '+project+
'</title>\n')
131 f.write(
'<link rel="stylesheet" href="atlasdqm.css" type="text/css" />\n')
132 f.write(
'<script type="text/javascript" src="AllDirs.js"><!-- dont contract--></script>')
134 f.write(
'<body>\n\n')
135 f.write(
'<h1>'+project+
' Monitoring</h1>\n\n')
136 f.write(
'<p><font class="Note">\n')
137 f.write(
'***Indicates reconstruction is in progress; histograms represent accumulated statistics and are temporary.\n')
138 f.write(
'</font></p>\n\n')
139 f.write(
'<table class="Catalogue">\n')
140 f.write(
'<tr><td><b>Run Number</b></td><td width="20"> </td>\n')
141 f.write(
' <td><b>T0 Iteration</b></td><td width="20"> </td>\n')
142 f.write(
' <td><b>Streams</b></td></tr>\n')
147 reversedRunDictKeys = [(
int(x), x)
for x
in runDict.keys()]
148 reversedRunDictKeys.sort()
149 reversedRunDictKeys.reverse()
150 reversedRunDictKeys = [x[1]
for x
in reversedRunDictKeys]; del x
151 for run
in reversedRunDictKeys:
154 runinfo = s.get_run_information({
'low_run': run,
'high_run': run}).
get(run,
None)
156 mouseovertext =
'Run %s<br/>Run Start: %s<br/>' % (run, time.strftime(
'%Y-%m-%d %H:%M %Z', time.localtime(runinfo[4])))
158 mouseovertext += (
'Run End: %s<br/>' % time.strftime(
'%Y-%m-%d %H:%M %Z', time.localtime(runinfo[5])))
160 mouseovertext += (
'Event Filter Events: %s<br/>' % runinfo[3])
161 mouseovertext += (
'Project Tag: %s<br/>' % runinfo[1])
163 mouseovertext += (
'Partition: %s<br/>' % runinfo[2])
166 procDict = runDict[run]
167 nproc = len(procDict.keys())
168 margin =
' <td rowspan="' +
str(nproc) +
'" valign="top" align="right">'
169 margin +=
'<a href="http://atlas-service-db-runlist.web.cern.ch/atlas-service-db-runlist/cgi-bin/runDetails.py?run=' +
str(run) +
"""" onMouseover="showhint('""" + mouseovertext +
"""', this, event, '400px')">"""
170 margin +=
str(run) +
'</a></td>\n'
171 margin +=
' <td rowspan="' +
str(nproc) +
'"></td>\n'
172 sortedProcKeys = procDict.keys()
173 sortedProcKeys.sort()
174 for proc
in sortedProcKeys:
176 f.write(
'<tr bgcolor="' + bgcolor +
'">\n')
180 f.write(
' <td align="right">' +
str(proc) +
'</td>\n')
181 f.write(
' <td></td>\n')
186 streamList = procDict[proc]
187 sortedStreamList = [ ]
188 for stream
in streamList:
189 if stream.find(
"Express") != -1:
190 sortedStreamList.append(stream)
191 streamList.remove(stream)
193 tmpSortedList = streamList
195 for stream
in streamList:
196 sortedStreamList.append(stream)
198 for stream
in sortedStreamList:
199 link = stream +
'/run_' + run
200 proci = stream.rfind(
"/")
201 shortStream = stream[proci+1:]
202 if shortStream.find(
"tmp_") == 0:
203 shortStream = shortStream.replace(
"tmp_",
"")
206 f.write(
' [<a href="' + link +
'">' + shortStream +
'</a>]')
207 endtext =
' \n'
209 f.write(
'\n </td>\n')
212 writeBGColor =
not writeBGColor
214 f.write(
'</table>\n')