Exemplo n.º 1
0
def serve(method, args):
    cat.log_event("hook", "receive")
    with cat.Transaction("serve", method) as t:
        try:
            t.add_data(json.dumps(args))
            cat.log_event("hook", "before1")
            cat.log_event("hook", "before2")
            cat.log_event("hook", "before3")
            res = func(method, args)
        finally:
            cat.metric("rpc-count").count()
            cat.metric("rpc-duration").duration(100)
            cat.log_event("hook", "after")
    return res
Exemplo n.º 2
0
def serve(method, args):
    cat.log_event("hook", "receive")
    with cat.Transaction("serve", method) as t:
        try:
            t.add_data(json.dumps(args))
            cat.log_event("hook", "before1")
            cat.log_event("hook", "before2")
            cat.log_event("hook", "before3")
            res = func(method, args)
        finally:
            cat.metric("rpc-count").count()
            cat.metric("rpc-duration").duration(100)
            cat.log_event("hook", "after")
    return res
Exemplo n.º 3
0
def test1():
    cat.metric("metric1").count()
Exemplo n.º 4
0
def test5():
    cat.metric("metric4").add_tag(
        "color", "red").add_tag("category", "hat").count()
    cat.metric("metric4").add_tag("color", "red").add_tag(
        "category", "glass").count()
Exemplo n.º 5
0
def test4():
    cat.metric("metric3").add_tag("color", "red").count()
    cat.metric("metric3").add_tag("color", "yellow").count()
    cat.metric("metric3").add_tag("color", "blue").count()
Exemplo n.º 6
0
def test3():
    cat.metric("metric2").duration(152)
Exemplo n.º 7
0
def test2():
    cat.metric("metric1").count(2)
Exemplo n.º 8
0
def test1():
    cat.metric("metric1").count()
Exemplo n.º 9
0
def test5():
    cat.metric("metric4").add_tag("color", "red").add_tag("category",
                                                          "hat").count()
    cat.metric("metric4").add_tag("color", "red").add_tag("category",
                                                          "glass").count()
Exemplo n.º 10
0
def test4():
    cat.metric("metric3").add_tag("color", "red").count()
    cat.metric("metric3").add_tag("color", "yellow").count()
    cat.metric("metric3").add_tag("color", "blue").count()
Exemplo n.º 11
0
def test3():
    cat.metric("metric2").duration(152)
Exemplo n.º 12
0
def test2():
    cat.metric("metric1").count(2)