Beispiel #1
0
def process_tokens(line):
    if 'path' in line.keys():
        if line['path'].startswith('/v2.0/tokens/'):
            output_statsd_count("sp.nginx.ord1a.tokens.{0}.total".format(line['method'].lower()))
            if line['response_code'] != "200":
                output_statsd_count("sp.nginx.ord1a.tokens.{0}.failure".format(line['method'].lower()))
            output_statsd_timer("sp.nginx.ord1a.tokens.{0}.service_time".format(line['method'].lower()), line['service_time'])
Beispiel #2
0
def process_status(line):
    if 'path' in line.keys():
        if line['path'].startswith('/v2.0/status/'):
            output_statsd_count("sp.nginx.ord1a.status.total")
            if line['response_code'] == "200":
                output_statsd_count("sp.nginx.ord1a.status.successful")
            else:
                output_statsd_count("sp.nginx.ord1a.status.failure")
           
            output_statsd_timer("sp.nginx.ord1a.status.service_time", line['service_time'])
Beispiel #3
0
def process_api(line):
    if 'path' in line.keys():
        if line['path'].startswith('/api/'):
            output_statsd_count('call.api')
Beispiel #4
0
def process_os_and_user_agent_request(line):
    if 'client' in line.keys():
        user_agent, os = _get_platform(line['client'])
        metric_name = 'browser_request.{0}.{1}'.format(user_agent, os)
        output_statsd_count(metric_name)