Gofaster API returning internal server errors

RESOLVED FIXED

Status

Testing Graveyard
GoFaster
--
critical
RESOLVED FIXED
4 years ago
a year ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

(Assignee)

Description

4 years ago
eg: http://brasstacks.mozilla.com/gofaster/api/endtoendtimes/average/?range=30&include_outliers=0

<type 'exceptions.TypeError'> at /api/endtoendtimes/average/
reduce() of empty sequence with no initial value
Python 	./handlers.py in get_mean_times, line 95
Web 	GET http://brasstacks.mozilla.com/api/endtoendtimes/average/


Traceback (innermost first)

    ./handlers.py in get_mean_times
        return get_build_data()['summaries']
        def get_build_jobs():
        return get_build_data()['build_jobs']
        def get_mean_times(data, buildtype, include_outliers):
        return_data = defaultdict(lambda: defaultdict(float))
        all_times = reduce(lambda x,y: x+y, reduce(lambda x,y: x+y, map(lambda d: d.values(), data.values()))) ...
        overall_mean = stats.mean(all_times)
        overall_stdev = stats.stdev(all_times)
        for (date, dateval) in data.iteritems():
        typedict = {}
        for (type, times) in dateval.iteritems():
        mean = stats.mean(times)
    ▼ Local vars
    Variable	Value
    buildtype	
    'both'
    data	
    defaultdict(<function <lambda> at 0x7f79fb7e6500>, {})
    include_outliers	
    0
    return_data	
    defaultdict(<function <lambda> at 0x7f79fb7e6d70>, {})
    ./handlers.py in GET
        else:
        items = defaultdict(lambda: defaultdict(lambda: []))
        end_to_end_times = []
        for date in sorted(set(map(lambda s: get_datestr(s['submitted_at']), summaries))):
        for summary in filter(lambda s: get_datestr(s['submitted_at'])==date, summaries):
        items[date]["both"].append(summary['time_taken_overall'])
        return { 'all': get_mean_times(items, "both", include_outliers) } ...
        #Execution Time handler returns average execution time for builds and tests
        class ExecutionTimeHandler(object):
        @templeton.handlers.json_response
        def GET(self, type):
    ▼ Local vars
    Variable	Value
    body	
    None
    end_to_end_times	
    []
    filtered_summaries	
    []
    include_outliers	
    0
    items	
    defaultdict(<function <lambda> at 0x7f79fb7e6500>, {})
    mode	
    u'average'
    params	
    {u'include_outliers': [u'0'], u'range': [u'30']}
    range	
    30
    revisions_processed	
    {}
    self	
    <handlers.EndToEndTimeHandler object at 0x7f79ebe23750>
    summaries	
    []
(Assignee)

Updated

4 years ago
Summary: Gofaster API returning 500 internal server errors → Gofaster API returning internal server errors
(Assignee)

Comment 1

4 years ago
No idea why it broke, but manually running the data import seems to have fixed it:

[webtools@brasstacks1.dmz.scl3 ~]$ ./apps/gofaster_dashboard/bin/fetch-and-process-builddata.sh
--2013-10-30 10:20:53--  http://builddata.pub.build.mozilla.org/reports/buildfaster.csv.gz
Resolving builddata.pub.build.mozilla.org... 63.245.215.57
Connecting to builddata.pub.build.mozilla.org|63.245.215.57|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1485792 (1.4M) [text/plain]
Saving to: â?oSTDOUTâ??

100%[====================================================================>] 1,485,792   --.-K/s   in 0.1s

2013-10-30 10:20:54 (9.58 MB/s) - written to stdout [1485792/1485792]


-> 17:22:55.663 GET http://brasstacks.mozilla.com/gofaster/api/endtoendtimes/average/ [HTTP/1.1 200 OK 246ms]
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Assignee: nobody → emorley

Updated

4 years ago
No longer blocks: 712206
Depends on: 712206
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.