[Swift-commit] r7575 - in trunk: . bin etc etc/provenance
lgadelha at ci.uchicago.edu
lgadelha at ci.uchicago.edu
Thu Feb 6 17:53:25 CST 2014
Author: lgadelha
Date: 2014-02-06 17:53:25 -0600 (Thu, 06 Feb 2014)
New Revision: 7575
Added:
trunk/etc/provenance/
trunk/etc/provenance/schema_sqlite.sql
Removed:
trunk/provenance/
Modified:
trunk/bin/swiftlog
Log:
Moved schema to etc/provenance/
Modified: trunk/bin/swiftlog
===================================================================
--- trunk/bin/swiftlog 2014-02-06 22:14:52 UTC (rev 7574)
+++ trunk/bin/swiftlog 2014-02-06 23:53:25 UTC (rev 7575)
@@ -195,7 +195,7 @@
# Initializes database if it not yet exists
if not(os.path.exists(provDB)):
print "Provenance import: creating database"
- schemaFilename=swiftHomeDir + "/provenance/schema_sqlite.sql"
+ schemaFilename=swiftHomeDir + "/etc/provenance/schema_sqlite.sql"
schema=open(schemaFilename, "r").read()
conn = sqlite3.connect(provDB)
c = conn.cursor()
@@ -243,7 +243,7 @@
if 'APP_RESOURCES' in line:
for i, pair in enumerate(line.lstrip('APP_RESOURCES=').split(',')):
entry=pair.split(':')
- if i == 1:
+ if i == 0:
c.execute("INSERT INTO resource_usage (app_exec_id, %s) VALUES ('%s',%s)" % (entry[0], appExecId, entry[1].rstrip('%')))
else:
c.execute("UPDATE resource_usage SET %s=%s WHERE app_exec_id='%s'" % (entry[0], entry[1].rstrip('%'), appExecId))
Added: trunk/etc/provenance/schema_sqlite.sql
===================================================================
--- trunk/etc/provenance/schema_sqlite.sql (rev 0)
+++ trunk/etc/provenance/schema_sqlite.sql 2014-02-06 23:53:25 UTC (rev 7575)
@@ -0,0 +1,74 @@
+create table script_run (
+ script_run_id text primary key,
+ script_filename text,
+ log_filename text,
+ hostname text,
+ script_run_dir text,
+ swift_version text,
+ cog_version text,
+ final_state text,
+ start_time text,
+ duration real
+);
+
+create table app_exec (
+ app_exec_id text primary key,
+ script_run_id references script_run(script_run_id),
+ app__name text,
+ execution_site text,
+ start_time text,
+ duration real,
+ staging_in_duration real,
+ staging_out_duration real,
+ work_directory text
+);
+
+create table argument (
+ app_exec_id text references app_exec (app_exec_id),
+ arg_position integer,
+ app_exec_arg text
+);
+
+create table resource_usage (
+ app_exec_id text primary key references app_exec (app_exec_id),
+ real_secs real,
+ kernel_secs real,
+ user_secs real,
+ percent_cpu integer,
+ max_rss integer,
+ avg_rss integer,
+ avg_tot_vm integer,
+ avg_priv_data integer,
+ avg_priv_stack integer,
+ avg_shared_text integer,
+ page_size integer,
+ major_pgfaults integer,
+ minor_pgfaults integer,
+ swaps integer,
+ invol_context_switches integer,
+ vol_waits integer,
+ fs_reads integer,
+ fs_writes integer,
+ sock_recv integer,
+ sock_send integer,
+ signals integer,
+ exit_status integer
+);
+
+create table file (
+ file_id text primary key,
+ host text,
+ name text,
+ size integer,
+ modify integer
+);
+
+create table staged_in (
+ app_exec_id text references app_exec (app_exec_id),
+ file_id text references file (file_id)
+);
+
+create table staged_out (
+ app_exec_id text references app_exec (app_exec_id),
+ file_id text references file (file_id)
+);
\ No newline at end of file
More information about the Swift-commit
mailing list