Merge lp:~cjohnston/launchpad-work-items-tracker/add-print-statement-debug into lp:launchpad-work-items-tracker

Proposed by Chris Johnston
Status: Merged
Merged at revision: 302
Proposed branch: lp:~cjohnston/launchpad-work-items-tracker/add-print-statement-debug
Merge into: lp:launchpad-work-items-tracker
Diff against target: 49 lines (+8/-2)
1 file modified
all-projects (+8/-2)
To merge this branch: bzr merge lp:~cjohnston/launchpad-work-items-tracker/add-print-statement-debug
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+120827@code.launchpad.net

Commit message

Adds print statements to functions on all-projects for debugging

Description of the change

Since the move from one DC to another DC last week, the amount of time to process the scripts has more than doubled. IS said that the move shouldn't be causing the increase in time. This merge will print out the start and stop times for the different command allowing us to further track and debug the cause of the extended time.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

31 + print "Publish new database started at: ", datetime.datetime.now(), "for", config_file

Should be "ended" I think?

Otherwise this looks good.

Thanks,

James

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'all-projects'
--- all-projects 2011-07-08 10:08:00 +0000
+++ all-projects 2012-08-22 16:34:24 +0000
@@ -12,9 +12,11 @@
12import shutil12import shutil
13import subprocess13import subprocess
14import sys14import sys
15import datetime
1516
1617
17def collect(source_dir, db_file, config_file, extra_args):18def collect(source_dir, db_file, config_file, extra_args):
19 print "Launchpad collect started at: ", datetime.datetime.now(), "for", config_file
18 args = [os.path.join(source_dir, "collect")]20 args = [os.path.join(source_dir, "collect")]
19 args.extend(["-d", db_file])21 args.extend(["-d", db_file])
20 args.extend(["-c", config_file])22 args.extend(["-c", config_file])
@@ -22,19 +24,22 @@
22 proc = subprocess.Popen(args)24 proc = subprocess.Popen(args)
23 proc.communicate()25 proc.communicate()
24 return proc.returncode == 026 return proc.returncode == 0
2527 print "Launchpad collect ended at: ", datetime.datetime.now(), "for", config_file
2628
27def publish_new_db(project_name, project_output_dir, db_file):29def publish_new_db(project_name, project_output_dir, db_file):
30 print "Publish new database started at: ", datetime.datetime.now(), "for", config_file
28 if not os.path.exists(project_output_dir):31 if not os.path.exists(project_output_dir):
29 os.makedirs(project_output_dir)32 os.makedirs(project_output_dir)
30 target_file = os.path.join(project_output_dir, "%s.db" % project_name)33 target_file = os.path.join(project_output_dir, "%s.db" % project_name)
31 temp_file = target_file + ".new"34 temp_file = target_file + ".new"
32 shutil.copyfile(db_file, temp_file)35 shutil.copyfile(db_file, temp_file)
33 os.rename(temp_file, target_file)36 os.rename(temp_file, target_file)
37 print "Publish new database started at: ", datetime.datetime.now(), "for", config_file
3438
3539
36def generate_reports(project_output_dir, config_file, db_file, source_dir,40def generate_reports(project_output_dir, config_file, db_file, source_dir,
37 extra_args, debug=False):41 extra_args, debug=False):
42 print "Generate reports started at: ", datetime.datetime.now(), "for", config_file
38 stdout = None43 stdout = None
39 if not debug:44 if not debug:
40 stdout = subprocess.PIPE45 stdout = subprocess.PIPE
@@ -46,7 +51,8 @@
46 proc = subprocess.Popen(args, stdout=stdout)51 proc = subprocess.Popen(args, stdout=stdout)
47 proc.communicate()52 proc.communicate()
48 assert proc.returncode == 0, "generate-all failed for %s" % config_file53 assert proc.returncode == 0, "generate-all failed for %s" % config_file
4954 print "Generate reports ended at: ", datetime.datetime.now(), "for", config_file
55
5056
51def backup_db(project_name, project_output_dir, current_time):57def backup_db(project_name, project_output_dir, current_time):
52 project_db = os.path.join(project_output_dir, "%s.db" % project_name)58 project_db = os.path.join(project_output_dir, "%s.db" % project_name)

Subscribers

People subscribed via source and target branches

to all changes: