mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 12:28:44 +00:00
output_processor/sqlite: Fix typo in function name
Correct the word connecton to connection.
This commit is contained in:
parent
f05a64ef95
commit
ae0b7c9894
@ -124,7 +124,7 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
metrics = [(self._spec_oid, job_output.iteration, m.name, str(m.value), m.units, int(m.lower_is_better))
|
metrics = [(self._spec_oid, job_output.iteration, m.name, str(m.value), m.units, int(m.lower_is_better))
|
||||||
for m in job_output.metrics]
|
for m in job_output.metrics]
|
||||||
if metrics:
|
if metrics:
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
conn.executemany('INSERT INTO metrics VALUES (?,?,?,?,?,?)', metrics)
|
conn.executemany('INSERT INTO metrics VALUES (?,?,?,?,?,?)', metrics)
|
||||||
|
|
||||||
def export_run_output(self, run_output, target_info):
|
def export_run_output(self, run_output, target_info):
|
||||||
@ -134,11 +134,11 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
metrics = [(self._spec_oid, run_output.iteration, m.name, str(m.value), m.units, int(m.lower_is_better))
|
metrics = [(self._spec_oid, run_output.iteration, m.name, str(m.value), m.units, int(m.lower_is_better))
|
||||||
for m in run_output.metrics]
|
for m in run_output.metrics]
|
||||||
if metrics:
|
if metrics:
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
conn.executemany('INSERT INTO metrics VALUES (?,?,?,?,?,?)', metrics)
|
conn.executemany('INSERT INTO metrics VALUES (?,?,?,?,?,?)', metrics)
|
||||||
|
|
||||||
info = run_output.info
|
info = run_output.info
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
conn.execute('''UPDATE runs SET start_time=?, end_time=?, duration=?
|
conn.execute('''UPDATE runs SET start_time=?, end_time=?, duration=?
|
||||||
WHERE OID=?''', (info.start_time, info.end_time, info.duration, self._run_oid))
|
WHERE OID=?''', (info.start_time, info.end_time, info.duration, self._run_oid))
|
||||||
|
|
||||||
@ -164,12 +164,12 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
self._run_initialized = True
|
self._run_initialized = True
|
||||||
|
|
||||||
def _init_db(self):
|
def _init_db(self):
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
for command in SCHEMA:
|
for command in SCHEMA:
|
||||||
conn.execute(command)
|
conn.execute(command)
|
||||||
|
|
||||||
def _validate_schema_version(self):
|
def _validate_schema_version(self):
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
try:
|
try:
|
||||||
c = conn.execute('SELECT schema_version FROM __meta')
|
c = conn.execute('SELECT schema_version FROM __meta')
|
||||||
found_version = c.fetchone()[0]
|
found_version = c.fetchone()[0]
|
||||||
@ -181,7 +181,7 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
raise ResultProcessorError(message.format(self.database, found_version, SCHEMA_VERSION))
|
raise ResultProcessorError(message.format(self.database, found_version, SCHEMA_VERSION))
|
||||||
|
|
||||||
def _update_run(self, run_uuid):
|
def _update_run(self, run_uuid):
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
conn.execute('INSERT INTO runs (uuid) VALUES (?)', (run_uuid,))
|
conn.execute('INSERT INTO runs (uuid) VALUES (?)', (run_uuid,))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
c = conn.execute('SELECT OID FROM runs WHERE uuid=?', (run_uuid,))
|
c = conn.execute('SELECT OID FROM runs WHERE uuid=?', (run_uuid,))
|
||||||
@ -193,14 +193,14 @@ class SqliteResultProcessor(OutputProcessor):
|
|||||||
json.dumps(spec.boot_parameters.to_pod()),
|
json.dumps(spec.boot_parameters.to_pod()),
|
||||||
json.dumps(spec.runtime_parameters.to_pod()),
|
json.dumps(spec.runtime_parameters.to_pod()),
|
||||||
json.dumps(spec.workload_parameters.to_pod()))
|
json.dumps(spec.workload_parameters.to_pod()))
|
||||||
with self._open_connecton() as conn:
|
with self._open_connection() as conn:
|
||||||
conn.execute('INSERT INTO workload_specs VALUES (?,?,?,?,?,?,?,?)', spec_tuple)
|
conn.execute('INSERT INTO workload_specs VALUES (?,?,?,?,?,?,?,?)', spec_tuple)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
c = conn.execute('SELECT OID FROM workload_specs WHERE run_oid=? AND id=?', (self._run_oid, spec.id))
|
c = conn.execute('SELECT OID FROM workload_specs WHERE run_oid=? AND id=?', (self._run_oid, spec.id))
|
||||||
self._spec_oid = c.fetchone()[0]
|
self._spec_oid = c.fetchone()[0]
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def _open_connecton(self):
|
def _open_connection(self):
|
||||||
conn = sqlite3.connect(self.database)
|
conn = sqlite3.connect(self.database)
|
||||||
try:
|
try:
|
||||||
yield conn
|
yield conn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user