Merge lp://staging/~ev/oops-repository/weighted-machines into lp://staging/~daisy-pluckers/oops-repository/trunk
Status: | Merged |
---|---|
Merged at revision: | 63 |
Proposed branch: | lp://staging/~ev/oops-repository/weighted-machines |
Merge into: | lp://staging/~daisy-pluckers/oops-repository/trunk |
Diff against target: |
125 lines (+63/-4) 3 files modified
oopsrepository/oopses.py (+32/-0) oopsrepository/schema.py (+14/-0) oopsrepository/tests/test_oopses.py (+17/-4) |
To merge this branch: | bzr merge lp://staging/~ev/oops-repository/weighted-machines |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daisy Pluckers | Pending | ||
Review via email: mp+153887@code.staging.launchpad.net |
Description of the change
This adds a new method, update_
More complete details of the implementation can be found in bug 1077122. The big difference from that write up is that instead of using a new uuid1() for the column name in ErrorsByRelease, we re-use the OOPS ID UUID, so that the script in https:/
On Mon, Mar 18, 2013 at 05:52:20PM -0000, Evan Dandrea wrote: /code.launchpad .net/~ev/ oops-repository /weighted- machines/ +merge/ 153887 errors_ by_release, which populates the /code.launchpad .net/~ev/ daisy/weighted- machines/ +merge/ 153885
> Evan Dandrea has proposed merging
> lp:~ev/oops-repository/weighted-machines into
> lp:~daisy-pluckers/oops-repository/trunk.
>
> Requested reviews:
> Daisy Pluckers (daisy-pluckers)
>
> For more details, see:
> https:/
>
> This adds a new method, update_
> FirstError column family with the first occurrence of an error for the
> given system identifier in the given Ubuntu release. It then writes
> this first occurrence into the ErrorsByRelease CF for the given Ubuntu
> release and today's date under the OOPS ID. This allows us to look up
> all the errors that occurred for an Ubuntu release for each day,
> weighting each error in the result set by how many days its been since
> its first error, as discussed in bug 1077122.
>
> More complete details of the implementation can be found in bug
> 1077122. The big difference from that write up is that instead of
> using a new uuid1() for the column name in ErrorsByRelease, we re-use
> the OOPS ID UUID, so that the script in
> https:/
> can be idempotent on multiple runs.
> -- /code.launchpad .net/~ev/ oops-repository /weighted- machines/ +merge/ 153887
> https:/
> Your team Daisy Pluckers is requested to review the proposed merge of lp:~ev/oops-repository/weighted-machines into lp:~daisy-pluckers/oops-repository/trunk.
> === modified file 'oopsrepository /oopses. py' oopses. py 2013-03-12 00:22:41 +0000 oopses. py 2013-03-18 17:51:27 +0000 cassandra. ttypes import NotFoundException errors_ by_release( config, oops_id, system_token, release): encode( 'utf8') pool(config) ColumnFamily( pool, 'FirstError') ColumnFamily( pool, 'ErrorsByRelease') datetime. today() hour=0, minute=0, second=0, microsecond=0) get(release, columns= [system_ token]) date[system_ token] insert( release, {system_token: today})
> --- oopsrepository/
> +++ oopsrepository/
> @@ -9,6 +9,7 @@
> import json
> import time
> import uuid
> +import datetime
>
> import pycassa
> from pycassa.
> @@ -186,6 +187,37 @@
> except NotFoundException:
> return None
>
> +def update_
> + release = release.
> + pool = connection_
> + firsterror = pycassa.
> + errorsbyrelease = pycassa.
> +
> + today = datetime.
> + today = today.replace(
> + try:
> + first_error_date = firsterror.
> + first_error_date = first_error_
> + except NotFoundException:
> + firsterror.
> + first_error_date = today
> +
> + # We use the OOPS ID rather than the system identifier here because we want
> + # each crash from a system to take up a new column in this column family.
> + # Each one of those columns should be associated with the date of the first
> + # error for the system in this release.
> + #
> + # Remember, we're ultimately tracking errors here, not systems, but we need
> + # the system idnetifier to know the first occurance of an error in the
typo: identifier
> + # release for that machine.
> + #
> + # For the given release for today, the crash should be...