CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
valtools.benchmark Class Reference

Public Member Functions

def __init__ (self, arg=None)
 
def __str__ (self)
 
def addLinkToComparison (self, website, comparison)
 
def benchmarkOnWebSite (self, website)
 
def benchmarkUrl (self, website)
 
def exists (self, website)
 
def fullName (self)
 
def makeRelease (self, website)
 
def releaseOnWebSite (self, website)
 
def releaseUrl (self, website)
 
def rootFileOnWebSite (self, website)
 

Public Attributes

 benchmark_
 
 benchmarkWithExt_
 
 indexHtml_
 
 release_
 

Detailed Description

Definition at line 135 of file valtools.py.

Constructor & Destructor Documentation

def valtools.benchmark.__init__ (   self,
  arg = None 
)

Definition at line 140 of file valtools.py.

140  def __init__(self, arg=None):
141 
142  release = None
143  benchName = None
144  extension = None
145  self.indexHtml_ = 'index.html'
146 
147  if arg != None:
148  (release, benchName, extension) = decodePath( arg )
149 
150  if release == None:
151  # we get there if:
152  # - arg == None
153  # - the decoding of arg as a full benchmark name has failed.
154  self.release_ = os.environ['CMSSW_VERSION']
155 
156  # benchmark directory, as the current working directory
157  self.benchmark_ = os.path.basename( os.getcwd() )
158 
159  # underscore are not allowed in extension names
160  if arg!=None and arg.count('_'):
161  print('sorry, as said many times, underscores are not allowed in the extension ;P')
162  sys.exit(5)
163 
164  extension = arg
165  else:
166  self.release_ = release
167  self.benchmark_ = benchName
168 
170  if( extension != None ):
171  self.benchmarkWithExt_ = '%s_%s' % (self.benchmark_, extension)
172 
173 
def decodePath(path)
Definition: valtools.py:275
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def __init__(self, arg=None)
Definition: valtools.py:140

Member Function Documentation

def valtools.benchmark.__str__ (   self)

Definition at line 174 of file valtools.py.

References valtools.benchmark.benchmarkWithExt_, and valtools.benchmark.release_.

174  def __str__(self):
175  return self.release_ + '/' + self.benchmarkWithExt_
176 
def __str__(self)
Definition: valtools.py:174
def valtools.benchmark.addLinkToComparison (   self,
  website,
  comparison 
)

Definition at line 215 of file valtools.py.

References valtools.benchmark.benchmarkOnWebSite(), and valtools.benchmark.indexHtml_.

215  def addLinkToComparison( self, website, comparison ):
216  url = comparison.comparisonUrl( website )
217  index = self.benchmarkOnWebSite(website) + '/' + self.indexHtml_
218  indexTmp = self.benchmarkOnWebSite(website) + '/index.tmp.html'
219  indexFile = open( index)
220  indexFileTmp = open( indexTmp, 'w')
221  for line in indexFile:
222  p = re.compile('<h2>Comparisons:</h2>')
223  m = p.match(line)
224  indexFileTmp.write(line)
225  if m:
226  link = '<A href="%s">%s</A><BR>\n' % (url, url)
227  indexFileTmp.write(link)
228  shutil.move( indexTmp, index)
229 
def addLinkToComparison(self, website, comparison)
Definition: valtools.py:215
def benchmarkOnWebSite(self, website)
Definition: valtools.py:183
def valtools.benchmark.benchmarkOnWebSite (   self,
  website 
)

Definition at line 183 of file valtools.py.

References perftools::EdmEventSize::BranchRecord.fullName, DTLocalTriggerBaseTest.fullName(), and valtools.benchmark.fullName().

Referenced by valtools.benchmark.addLinkToComparison(), valtools.benchmark.exists(), and valtools.benchmark.rootFileOnWebSite().

183  def benchmarkOnWebSite( self, website ):
184  return '%s/%s' % ( website, self.fullName() )
185 # return '%s/%s' % ( self.releaseOnWebSite(website),
186 # self.benchmarkWithExt_ )
187 
def fullName(self)
Definition: valtools.py:177
def benchmarkOnWebSite(self, website)
Definition: valtools.py:183
def valtools.benchmark.benchmarkUrl (   self,
  website 
)

Definition at line 196 of file valtools.py.

References valtools.benchmark.benchmarkWithExt_, and valtools.benchmark.releaseUrl().

196  def benchmarkUrl( self, website ):
197  return '%s/%s' % ( self.releaseUrl( website ),
198  self.benchmarkWithExt_ )
199 
def releaseUrl(self, website)
Definition: valtools.py:192
def benchmarkUrl(self, website)
Definition: valtools.py:196
def valtools.benchmark.exists (   self,
  website 
)

Definition at line 207 of file valtools.py.

References valtools.benchmark.benchmarkOnWebSite(), valtools.benchmark.benchmarkWithExt_, edm.print(), and valtools.benchmark.release_.

207  def exists( self, website):
208  if( os.path.isdir( self.benchmarkOnWebSite(website) )):
209  print('benchmark %s exists for release %s' % (self.benchmarkWithExt_, self.release_))
210  return True
211  else:
212  print('benchmark %s does not exist for release %s' % (self.benchmarkWithExt_, self.release_))
213  return False
214 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def exists(self, website)
Definition: valtools.py:207
def benchmarkOnWebSite(self, website)
Definition: valtools.py:183
def valtools.benchmark.fullName (   self)

Definition at line 177 of file valtools.py.

References valtools.benchmark.benchmarkWithExt_, and valtools.benchmark.release_.

Referenced by valtools.benchmark.benchmarkOnWebSite().

177  def fullName(self):
178  return self.release_ + '/' + self.benchmarkWithExt_
179 
def fullName(self)
Definition: valtools.py:177
def valtools.benchmark.makeRelease (   self,
  website 
)

Definition at line 200 of file valtools.py.

References edm.print(), valtools.benchmark.release_, and valtools.benchmark.releaseOnWebSite().

200  def makeRelease( self, website):
201  rel = self.releaseOnWebSite(website)
202  if( os.path.isdir( rel )==False):
203  print('creating release %s' % self.release_)
204  print(rel)
205  os.mkdir( rel )
206 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def releaseOnWebSite(self, website)
Definition: valtools.py:180
def makeRelease(self, website)
Definition: valtools.py:200
def valtools.benchmark.releaseOnWebSite (   self,
  website 
)

Definition at line 180 of file valtools.py.

References valtools.benchmark.release_.

Referenced by valtools.benchmark.makeRelease().

180  def releaseOnWebSite( self, website ):
181  return '%s/%s' % ( website, self.release_ )
182 
def releaseOnWebSite(self, website)
Definition: valtools.py:180
def valtools.benchmark.releaseUrl (   self,
  website 
)

Definition at line 192 of file valtools.py.

References valtools.benchmark.release_.

Referenced by valtools.benchmark.benchmarkUrl().

192  def releaseUrl( self, website ):
193  return '%s/%s' % ( website.url_, self.release_ )
194 
195 
def releaseUrl(self, website)
Definition: valtools.py:192
def valtools.benchmark.rootFileOnWebSite (   self,
  website 
)

Definition at line 188 of file valtools.py.

References valtools.benchmark.benchmarkOnWebSite().

188  def rootFileOnWebSite( self, website ):
189  return '%s/%s' % ( self.benchmarkOnWebSite(website),
190  'benchmark.root' )
191 
def rootFileOnWebSite(self, website)
Definition: valtools.py:188
def benchmarkOnWebSite(self, website)
Definition: valtools.py:183

Member Data Documentation

valtools.benchmark.benchmark_

Definition at line 157 of file valtools.py.

valtools.benchmark.benchmarkWithExt_
valtools.benchmark.indexHtml_

Definition at line 145 of file valtools.py.

Referenced by valtools.benchmark.addLinkToComparison().

valtools.benchmark.release_