예제 #1
0
def issues_activity(owner, repo):
    index = index_name(owner, repo)
    opened = queries.past_n_months(
        index, partial(queries.issue_events_count, action='opened'),
        CHART_MONTHS)
    closed = queries.past_n_months(
        index, partial(queries.issue_events_count, action='closed'),
        CHART_MONTHS)
    data = {'opened': opened, 'closed': closed}
    return jsonify(data=data)
예제 #2
0
def issues_activity(owner, repo):
    index = index_name(owner, repo)
    mode = request.args.get('mode', 'weekly')
    if mode == 'weekly':
        opened = queries.past_n_weeks(index, partial(queries.issue_events_count, action='opened'), CHART_INTERVALS)
        closed = queries.past_n_weeks(index, partial(queries.issue_events_count, action='closed'), CHART_INTERVALS)
        data = {'opened': opened, 'closed': closed}
    elif mode == 'monthly':
        opened = queries.past_n_months(index, partial(queries.issue_events_count, action='opened'), CHART_INTERVALS)
        closed = queries.past_n_months(index, partial(queries.issue_events_count, action='closed'), CHART_INTERVALS)
        data = {'opened': opened, 'closed': closed}
    else:
        data = 'Mode not supported. Use ?mode=weekly or monthly'
    return jsonify(data=data)
예제 #3
0
def popularity_evolution(owner, repo):
    index = index_name(owner, repo)
    mode = request.args.get('mode', 'weekly')
    if mode == 'weekly':
        data = queries.past_n_weeks(index, queries.popularity_events, CHART_INTERVALS)
    elif mode == 'monthly':
        data = queries.past_n_months(index, queries.popularity_events, CHART_INTERVALS)
    else:
        data = 'Mode not supported. Use ?mode=weekly or monthly'
    return jsonify(data=data)
예제 #4
0
def avg_issue_time(owner, repo):
    index = index_name(owner, repo)
    mode = request.args.get('mode', 'weekly')
    if mode == 'weekly':
        times = queries.past_n_weeks(index, queries.avg_issue_time, CHART_INTERVALS)
    elif mode == 'monthly':
        times = queries.past_n_months(index, queries.avg_issue_time, CHART_INTERVALS)
    else:
        times = 'Mode not supported. Use ?mode=weekly or monthly'
    return jsonify(data=times)
예제 #5
0
파일: api.py 프로젝트: iulianR/elasticboard
def popularity_evolution(owner, repo):
    index = index_name(owner, repo)
    mode = request.args.get('mode', 'weekly')
    if mode == 'weekly':
        data = queries.past_n_weeks(index, queries.popularity_events,
                                    CHART_INTERVALS)
    elif mode == 'monthly':
        data = queries.past_n_months(index, queries.popularity_events,
                                     CHART_INTERVALS)
    else:
        data = 'Mode not supported. Use ?mode=weekly or monthly'
    return jsonify(data=data)
예제 #6
0
파일: api.py 프로젝트: iulianR/elasticboard
def avg_issue_time(owner, repo):
    index = index_name(owner, repo)
    mode = request.args.get('mode', 'weekly')
    if mode == 'weekly':
        times = queries.past_n_weeks(index, queries.avg_issue_time,
                                     CHART_INTERVALS)
    elif mode == 'monthly':
        times = queries.past_n_months(index, queries.avg_issue_time,
                                      CHART_INTERVALS)
    else:
        times = 'Mode not supported. Use ?mode=weekly or monthly'
    return jsonify(data=times)
예제 #7
0
파일: api.py 프로젝트: iulianR/elasticboard
def issues_activity(owner, repo):
    index = index_name(owner, repo)
    mode = request.args.get('mode', 'weekly')
    if mode == 'weekly':
        opened = queries.past_n_weeks(
            index, partial(queries.issue_events_count, action='opened'),
            CHART_INTERVALS)
        closed = queries.past_n_weeks(
            index, partial(queries.issue_events_count, action='closed'),
            CHART_INTERVALS)
        data = {'opened': opened, 'closed': closed}
    elif mode == 'monthly':
        opened = queries.past_n_months(
            index, partial(queries.issue_events_count, action='opened'),
            CHART_INTERVALS)
        closed = queries.past_n_months(
            index, partial(queries.issue_events_count, action='closed'),
            CHART_INTERVALS)
        data = {'opened': opened, 'closed': closed}
    else:
        data = 'Mode not supported. Use ?mode=weekly or monthly'
    return jsonify(data=data)
예제 #8
0
def issues_activity(owner, repo):
    index = index_name(owner, repo)
    opened = queries.past_n_months(index, partial(queries.issue_events_count, action='opened'), CHART_MONTHS)
    closed = queries.past_n_months(index, partial(queries.issue_events_count, action='closed'), CHART_MONTHS)
    data = {'opened': opened, 'closed': closed}
    return jsonify(data=data)
예제 #9
0
def total_events_monthly(owner, repo):
    index = index_name(owner, repo)
    data = queries.past_n_months(index, queries.total_events, CHART_MONTHS)
    return jsonify(data=data)
예제 #10
0
def popularity_evolution(owner, repo):
    index = index_name(owner, repo)
    data = queries.past_n_months(index, queries.popularity_events, CHART_MONTHS)
    return jsonify(data=data)
예제 #11
0
def avg_issue_time(owner, repo):
    index = index_name(owner, repo)
    times = queries.past_n_months(index, queries.avg_issue_time, CHART_MONTHS)
    return jsonify(data=times)
예제 #12
0
def total_events_monthly(owner, repo):
    index = index_name(owner, repo)
    data = queries.past_n_months(index, queries.total_events, CHART_MONTHS)
    return jsonify(data=data)
예제 #13
0
def avg_issue_time(owner, repo):
    index = index_name(owner, repo)
    times = queries.past_n_months(index, queries.avg_issue_time, CHART_MONTHS)
    return jsonify(data=times)