示例#1
0
文件: 04.py 项目: yvk2493/pcp
def run_test():
    for testconfig in testconfigs:
        utils.print_test_section_separator()
        utils.pmdastatsd_install(testconfig)
        for payload in payloads:
            sock.sendto(payload.encode("utf-8"), (ip, port))
        utils.print_metric('statsd.pmda.received')
        utils.print_metric('statsd.pmda.parsed')
        utils.print_metric('statsd.pmda.aggregated')
        utils.print_metric('statsd.pmda.dropped')
        time_spent_parsing = utils.request_metric(
            'statsd.pmda.time_spent_parsing')
        if time_spent_parsing:
            val = extract_value(time_spent_parsing)
            if not val == "value 0":
                print("time_spent_parsing is not 0")
            else:
                print("time_spent_parsing is 0")
        time_spent_aggregating = utils.request_metric(
            'statsd.pmda.time_spent_aggregating')
        if time_spent_aggregating:
            val = extract_value(time_spent_aggregating)
            if not val == "value 0":
                print("time_spent_aggregating is not 0")
            else:
                print("time_spent_aggregating is 0")
        utils.print_metric('statsd.pmda.metrics_tracked')
        utils.pmdastatsd_remove()
        utils.restore_config()
示例#2
0
def run_test():
    utils.print_test_section_separator()
    utils.pmdastatsd_install(basic_duration_aggregation)
    for x in range(1, 101):
        sock.sendto("test_duration:{}|ms".format(x).encode("utf-8"),
                    (ip, port))
    utils.print_metric("statsd.test_duration")
    utils.pmdastatsd_remove()
    utils.restore_config()
示例#3
0
文件: 11.py 项目: yvk2493/pcp
def run_test():
    utils.print_test_section_separator()
    utils.pmdastatsd_install(port_a_config)
    sock.sendto("test_port_a:1|c".encode("utf-8"), (ip, port_a))
    print("Testing port {}".format(port_a))
    utils.print_metric("statsd.test_port_a")
    utils.pmdastatsd_remove()
    utils.restore_config()
    utils.pmdastatsd_install(port_b_config)
    sock.sendto("test_port_b:1|c".encode("utf-8"), (ip, port_b))
    print("Testing port {}".format(port_b))
    utils.print_metric("statsd.test_port_b")
    utils.pmdastatsd_remove()
    utils.restore_config()
示例#4
0
文件: 14.py 项目: yvk2493/pcp
def run_test():
    utils.print_test_section_separator()
    utils.pmdastatsd_install(maxudp_1)
    for payload in payloads:
        sock.sendto(payload.encode("utf-8"), (ip, port))
    time.sleep(1)
    utils.print_metric("statsd.pmda.metrics_tracked")
    utils.pmdastatsd_remove()
    utils.restore_config()
    utils.print_test_section_separator()
    utils.pmdastatsd_install(maxudp_2)
    for payload in payloads:
        sock.sendto(payload.encode("utf-8"), (ip, port))
    time.sleep(1)
    utils.print_metric("statsd.pmda.metrics_tracked")
    utils.pmdastatsd_remove()
    utils.restore_config()
    utils.print_test_section_separator()
    utils.pmdastatsd_install(maxudp_3)
    for payload in payloads:
        sock.sendto(payload.encode("utf-8"), (ip, port))
    time.sleep(1)
    utils.print_metric("statsd.pmda.metrics_tracked")
    utils.pmdastatsd_remove()
    utils.restore_config()
示例#5
0
def run_test():
    for testconfig in testconfigs:
        utils.print_test_section_separator()
        utils.pmdastatsd_install(basis_parser_config)
        for payload in payloads:
            sock.sendto("test_gauge:{}|g".format(payload).encode("utf-8"), (ip, port))
        utils.print_metric("statsd.pmda.dropped")
        utils.print_metric('statsd.test_gauge')
        overflow_payload = sys.float_info.max
        sock.sendto("test_gauge2:+{}|g".format(overflow_payload).encode("utf-8"), (ip, port))
        utils.print_metric("statsd.pmda.dropped")
        utils.print_metric("statsd.test_gauge2")
        sock.sendto("test_gauge2:+{}|g".format(overflow_payload).encode("utf-8"), (ip, port))
        utils.print_metric("statsd.pmda.dropped")
        utils.print_metric("statsd.test_gauge2")
        underflow_payload = sys.float_info.max * -1.0
        sock.sendto("test_gauge3:{}|g".format(underflow_payload).encode("utf-8"), (ip, port))
        utils.print_metric("statsd.pmda.dropped")
        utils.print_metric("statsd.test_gauge3")
        sock.sendto("test_gauge3:{}|g".format(underflow_payload).encode("utf-8"), (ip, port))
        utils.print_metric("statsd.pmda.dropped")
        utils.print_metric("statsd.test_gauge3")
        utils.pmdastatsd_remove()
        utils.restore_config()
示例#6
0
def run_test():
    for testconfig in testconfigs:
        utils.print_test_section_separator()
        utils.pmdastatsd_install(testconfig)
        utils.print_metric("statsd.pmda.dropped")
        for payload in payloads:
            sock.sendto("test_counter:{}|c".format(payload).encode("utf-8"),
                        (ip, port))
        utils.print_metric('statsd.test_counter')
        test_payload = sys.float_info.max
        sock.sendto("test_counter2:{}|c".format(test_payload).encode("utf-8"),
                    (ip, port))
        utils.print_metric("statsd.test_counter2")
        utils.print_metric("statsd.pmda.dropped")
        sock.sendto("test_counter2:{}|c".format(test_payload).encode("utf-8"),
                    (ip, port))
        utils.print_metric("statsd.test_counter2")
        utils.print_metric("statsd.pmda.dropped")
        utils.pmdastatsd_remove()
        utils.restore_config()
示例#7
0
def run_test():
    utils.print_test_section_separator()
    utils.pmdastatsd_install()
    utils.print_metric('statsd.pmda.received')
    utils.print_metric('statsd.pmda.parsed')
    utils.print_metric('statsd.pmda.aggregated')
    utils.print_metric('statsd.pmda.dropped')
    utils.print_metric('statsd.pmda.time_spent_parsing')
    utils.print_metric('statsd.pmda.time_spent_aggregating')
    utils.print_metric('statsd.pmda.metrics_tracked')
    utils.pmdastatsd_remove()
    utils.restore_config()