<commit_before>from flask import request, redirect, render_template
from . import index

from .. import db

@index.route('/', methods=['GET'])
def index():
    # read in GET request values
    spanName = request.args.get('spanName')
    serviceName = request.args.get('serviceName')
    timestamp = request.args.get('timestamp')

    if timestamp.strip() == '':
        timestamp = 'current_time'


    # get database engine connection
    connection = db.engine.connect()

    # populate spans
    spans = []
    result = connection.execute("SELECT DISTINCT span_name FROM zipkin_spans")

    for row in result:
        spans.append( row['span_name'] )

    # populate services
    services = []
    result = connection.execute("SELECT DISTINCT service_name FROM zipkin_annotations")

    for row in result:
        services.append( row['service_name'] )

    # close connection
    connection.close()

    return render_template('index.html', \
            spans=spans, services=services, \
            get_SpanName=spanName, get_ServiceName=serviceName, get_Timestamp=timestamp)<commit_msg>read in limit and timestamp values<commit_after>from time import time
from flask import request, redirect, render_template

from . import index
from .. import db

@index.route('/', methods=['GET'])
def index():
    # read GET values
    spanName = request.args.get('spanName')
    serviceName = request.args.get('serviceName')
    timestamp = request.args.get('timestamp')
    limit = request.args.get('limit')

    if timestamp is None or timestamp.strip() == '':
        timestamp = int(time() * 1000000)

    # get database engine connection
    connection = db.engine.connect()

    # populate spans
    spans = []
    result = connection.execute("SELECT DISTINCT span_name FROM zipkin_spans")

    for row in result:
        spans.append( row['span_name'] )

    # populate services
    services = []
    result = connection.execute("SELECT DISTINCT service_name FROM zipkin_annotations")

    for row in result:
        services.append( row['service_name'] )

    # close connection
    connection.close()

    return render_template('index.html', \
            spans=spans, services=services, \
            get_SpanName=spanName, get_ServiceName=serviceName, \
            get_Timestamp=timestamp, get_Limit=limit)
{'fraction_non_alphanumeric': 0.10933448573898012, 'fraction_numerical': 0.003025064822817632, 'mean_word_length': 3.263351749539595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3789356', 'n_tokens_mistral': 662, 'n_tokens_neox': 624, 'n_words': 168}