Definition at line 26 of file sim_check_batch.py.
◆ __init__()
def sim_check_batch.DataBase.__init__ |
( |
|
self, |
|
|
|
fname |
|
) |
| |
◆ _dumpTable()
def sim_check_batch.DataBase._dumpTable |
( |
|
self, |
|
|
|
t |
|
) |
| |
|
private |
Definition at line 41 of file sim_check_batch.py.
41 def _dumpTable(self,t):
44 self._execute(
'select * from %s'%t)
45 header= [ s[0]
for s
in self.cur.description ]
46 format=
' '.
join([
'%25s' for s
in self.cur.description])
47 print format%tuple(header)
48 for res
in self.cur.fetchall():
◆ _execute()
def sim_check_batch.DataBase._execute |
( |
|
self, |
|
|
|
cmd, |
|
|
|
args = () |
|
) |
| |
|
private |
◆ addCountAndLinks()
def sim_check_batch.DataBase.addCountAndLinks |
( |
|
self, |
|
|
|
rid, |
|
|
|
parser = None |
|
) |
| |
Definition at line 141 of file sim_check_batch.py.
141 def addCountAndLinks(self,rid,parser=None):
146 for fn
in parser.functions.values():
148 print 'ERROR fn=',fn.fn,
'not in db yet'
151 hargs=[
'rid',
'fid',
'selfcounts',
'totalcounts']
152 args=[rid,fn.dbid,fn.selfcost,fn.totalcost]
155 self.insert(
't_counts',hargs,args)
156 except IntegrityError
as detail:
157 print 'IntegrityError',detail
163 for i,counts
in fn.calls.iteritems():
165 cfn=self.parser.functions[i]
167 print 'ERROR cfn=',cfn.fn,
'not in db yet'
168 self.addFunction(cfn)
169 hargs=[
'rid',
'fid',
'cfunid',
'counts']
170 args=[rid,fn.dbid,cfn.dbid,counts]
172 self.insert(
't_links',hargs,args)
173 except IntegrityError
as detail:
174 print 'IntegrityError',detail
182 print 'some ERROR occured rolling back'
◆ addFile()
def sim_check_batch.DataBase.addFile |
( |
|
self, |
|
|
|
fl |
|
) |
| |
Definition at line 97 of file sim_check_batch.py.
98 "add file entry to db and return id"
100 if fl.dbid
is not None:
104 cmd=
'select id from t_files where fl_name=?'
105 self._execute(cmd,(fl.fl,))
106 res=self.cur.fetchone()
108 print 'WARNING',fl.fl,
'not found'
110 id=self.insert(
't_files',[
'fl_name'],[fl.fl])
◆ addFunction()
def sim_check_batch.DataBase.addFunction |
( |
|
self, |
|
|
|
fn |
|
) |
| |
Definition at line 117 of file sim_check_batch.py.
117 def addFunction(self,fn):
118 if self.parser.filelist.has_key(fn.fl_id):
119 fl=self.parser.filelist[fn.fl_id]
123 cmd=
'select id from t_functions where fn_name=? and fid=? and issue=?'
124 self._execute(cmd,(fn.fn,fid,fn.issue))
125 res=self.cur.fetchone()
128 hargs=[
'fn_name',
'fid',
'issue',
'lib']
129 args=[fn.fn,fid,fn.issue,fn.lib]
130 id = self.insert(
't_functions',hargs,args)
◆ addFunctions()
def sim_check_batch.DataBase.addFunctions |
( |
|
self, |
|
|
|
parser |
|
) |
| |
Definition at line 135 of file sim_check_batch.py.
135 def addFunctions(self,parser):
137 for fn
in parser.functions.values():
◆ addRun()
def sim_check_batch.DataBase.addRun |
( |
|
self | ) |
|
Definition at line 74 of file sim_check_batch.py.
77 atlasArea=os.getenv(
'AtlasArea')
78 dummy,branch,proj,rel=atlasArea.rsplit(
'/',3)
81 subcwd=os.getenv(
'LS_SUBCWD')
82 dummy1,cmt,dummy2,package,job=subcwd.rsplit(
'/',4)
84 rdate,rtime=dt.datetime.now().strftime(
'%Y-%m-%d %H:%M:%S').
split()
87 hostInfo=dict(zip(*hostInfo))
89 machine=hostInfo[
'HOST_NAME']
90 KSI2K_fac=
float(hostInfo[
'cpuf'])
91 hargs=[
'branch',
'rel',
'cmt',
'rdate',
'rtime',
'machine',
'KSI2K_fac',
'package',
'job']
92 args=[locals()[x]
for x
in hargs]
93 id=self.insert(
't_run',hargs,args)
◆ dummyHostInfo()
def sim_check_batch.DataBase.dummyHostInfo |
( |
|
self | ) |
|
Definition at line 62 of file sim_check_batch.py.
62 def dummyHostInfo(self):
63 hostInfo={
'HOST_NAME':
'lxplus443',
64 'RESOURCES':
'(intel plus quadcore wan)',
◆ insert()
def sim_check_batch.DataBase.insert |
( |
|
self, |
|
|
|
tname = 't_run' , |
|
|
|
hargs = [] , |
|
|
|
args = [] |
|
) |
| |
Definition at line 52 of file sim_check_batch.py.
52 def insert(self,tname='t_run',hargs=[],args=[]):
53 "create prepared statement and execute"
55 vals=
','.
join((
'?',)*len(args))
56 cmd=
"insert into %s (%s) values (%s)"%(tname,keys,vals)
59 self.rid=self.cur.lastrowid
◆ openConnection()
def sim_check_batch.DataBase.openConnection |
( |
|
self | ) |
|
Definition at line 32 of file sim_check_batch.py.
32 def openConnection(self):
34 self.cnx = sqlite3.connect(self.fname)
35 self.cur = self.cnx.
cursor()
◆ cnx
sim_check_batch.DataBase.cnx |
◆ cur
sim_check_batch.DataBase.cur |
◆ fname
sim_check_batch.DataBase.fname |
◆ parser
sim_check_batch.DataBase.parser |
◆ rid
sim_check_batch.DataBase.rid |
The documentation for this class was generated from the following file: