Merge lp://staging/~joetalbott/qa-dashboard/txstatsd_pull_scripts into lp://staging/qa-dashboard

Proposed by Joe Talbott
Status: Merged
Approved by: Chris Johnston
Approved revision: 678
Merged at revision: 676
Proposed branch: lp://staging/~joetalbott/qa-dashboard/txstatsd_pull_scripts
Merge into: lp://staging/qa-dashboard
Diff against target: 388 lines (+285/-33)
6 files modified
common/utils.py (+69/-0)
qa_dashboard/settings.py (+6/-0)
scripts/branch-update.py (+65/-0)
scripts/ci-dashboard-update.py (+143/-0)
scripts/qa-dashboard-update-fast.sh (+1/-13)
scripts/qa-dashboard-update-slow.sh (+1/-20)
To merge this branch: bzr merge lp://staging/~joetalbott/qa-dashboard/txstatsd_pull_scripts
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Andy Doan (community) Approve
Joe Talbott Needs Resubmitting
Review via email: mp+193958@code.staging.launchpad.net

Commit message

update scripts - Convert to python and add txstatsd metrics.

Description of the change

update scripts - Convert to python and add txstatsd metrics.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:677
http://10.97.0.26:8080/job/dashboard-ci/249/
Executed test runs:

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/dashboard-ci/249/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andy Doan (doanac) wrote :

51 + start_time = datetime.datetime.now()
52 + func(*args, **kwargs)
53 + end_time = datetime.datetime.now()
54 +
55 + delta = end_time - start_time
56 + ms = delta.seconds * 1000 + delta.microseconds / 1000
57 + seconds = float(ms) / 1000
58 + logging.info("ms: %s, s: %s", ms, seconds)

why not just do:

  start = time.time()
  func(*args, **kwargs)
  duration = time.time() - start

Revision history for this message
Andy Doan (doanac) wrote :

Seems like this could be its own function and be instantiated just once:

60 + statsd_client = UdpStatsDClient(TXSTATSD_HOST, TXSTATSD_PORT)
61 + metrics = ExtendedMetrics(
62 + connection=statsd_client,
63 + namespace=dashboard_metric_prefix,
64 + )
65 + statsd_client.connect()

Also - what happens when running from home? Does it just silently not hit snakefruit - if so, should we make it to where its an "opt-in" setting and we get a NULL statsd_client if its not configured?

Revision history for this message
Andy Doan (doanac) wrote :

I've always used context managers for things like this, but since they'd be going 4 indentations deep, maybe this better for this thing.

138 +@lockfile_dec(code_lock_file)
139 +@lockfile_dec(slow_lock_file, wait=True)
140 +@lockfile_dec(fast_lock_file, wait=True)
141 +@txstatsd_interval('branch_update')
142 +def branch_update():
143 + if subprocess.call(['bzr', 'missing']):
144 + subprocess.call(['bzr', 'pull'])

shouldn't this be a subprocess.check_call instead?

145 + call_command('syncdb')
146 + call_command('migrate')
147 + call_command('collectstatic', noinput=True)
148 +
149 + subprocess.call(['sudo', 'service', 'apache2', 'graceful'])

Shouldn't this be a subprocess.check_call also?

Revision history for this message
Joe Talbott (joetalbott) wrote :

I think I've addressed all of Andy's comments.

review: Needs Resubmitting
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:678
http://10.97.0.26:8080/job/dashboard-ci/250/
Executed test runs:

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/dashboard-ci/250/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andy Doan (doanac) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:678
http://10.97.0.26:8080/job/dashboard-ci/251/
Executed test runs:

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/dashboard-ci/251/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:678
http://10.97.0.26:8080/job/dashboard-ci/252/
Executed test runs:

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/dashboard-ci/252/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chris Johnston (cjohnston) wrote :

The `tree_dir` option for the target branch is not a lightweight checkout. Please ask a project administrator to resolve the issue, and try again.

Revision history for this message
Chris Johnston (cjohnston) wrote :

The attempt to merge lp:~joetalbott/qa-dashboard/txstatsd_pull_scripts into lp:qa-dashboard failed. Below is the output from the failed tests.

ImportError: No module named txstatsd.client

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches