Skip to content

Commit

Permalink
Update combine_traces() for schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Jun 1, 2017
1 parent 070d3f9 commit 5a934c5
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions reprozip/reprozip/traceutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ def combine_traces(traces, target):
logging.info("Insert processes...")
conn.execute(
'''
INSERT INTO processes(id, run_id, parent,
timestamp, is_thread, exitcode)
INSERT INTO processes(id, run_id, parent, timestamp,
exit_timestamp, cpu_time, is_thread,
exitcode)
SELECT p.new AS id, r.new AS run_id, parent,
timestamp, is_thread, exitcode
timestamp, exit_timestamp, cpu_time, is_thread, exitcode
FROM trace.processes t
INNER JOIN maps.map_runs r ON t.run_id = r.old
INNER JOIN maps.map_processes p ON t.id = p.old
Expand Down Expand Up @@ -237,6 +238,20 @@ def combine_traces(traces, target):
ORDER BY t.id;
''')

# connections
logging.info("Insert connections...")
conn.execute(
'''
INSERT INTO connections(run_id, timestamp, process, inbound,
family, protocol, address)
SELECT r.new AS run_id, timestamp, p.new AS process,
inbound, family, protocol, address
FROM trace.connections t
INNER JOIN maps.map_runs r ON t.run_id = r.old
INNER JOIN maps.map_processes p ON t.process = p.old
ORDER BY t.id;
''')

# Flush maps
conn.execute(
'''
Expand Down

0 comments on commit 5a934c5

Please sign in to comment.