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
1=== modified file 'all-projects'
2--- all-projects 2011-07-08 10:08:00 +0000
3+++ all-projects 2012-08-22 16:34:24 +0000
4@@ -12,9 +12,11 @@
5 import shutil
6 import subprocess
7 import sys
8+import datetime
9
10
11 def collect(source_dir, db_file, config_file, extra_args):
12+ print "Launchpad collect started at: ", datetime.datetime.now(), "for", config_file
13 args = [os.path.join(source_dir, "collect")]
14 args.extend(["-d", db_file])
15 args.extend(["-c", config_file])
16@@ -22,19 +24,22 @@
17 proc = subprocess.Popen(args)
18 proc.communicate()
19 return proc.returncode == 0
20-
21+ print "Launchpad collect ended at: ", datetime.datetime.now(), "for", config_file
22
23 def publish_new_db(project_name, project_output_dir, db_file):
24+ print "Publish new database started at: ", datetime.datetime.now(), "for", config_file
25 if not os.path.exists(project_output_dir):
26 os.makedirs(project_output_dir)
27 target_file = os.path.join(project_output_dir, "%s.db" % project_name)
28 temp_file = target_file + ".new"
29 shutil.copyfile(db_file, temp_file)
30 os.rename(temp_file, target_file)
31+ print "Publish new database started at: ", datetime.datetime.now(), "for", config_file
32
33
34 def generate_reports(project_output_dir, config_file, db_file, source_dir,
35 extra_args, debug=False):
36+ print "Generate reports started at: ", datetime.datetime.now(), "for", config_file
37 stdout = None
38 if not debug:
39 stdout = subprocess.PIPE
40@@ -46,7 +51,8 @@
41 proc = subprocess.Popen(args, stdout=stdout)
42 proc.communicate()
43 assert proc.returncode == 0, "generate-all failed for %s" % config_file
44-
45+ print "Generate reports ended at: ", datetime.datetime.now(), "for", config_file
46+
47
48 def backup_db(project_name, project_output_dir, current_time):
49 project_db = os.path.join(project_output_dir, "%s.db" % project_name)

Subscribers

People subscribed via source and target branches

to all changes: