Esempio 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
Esempio 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
Esempio n. 3
0
def test1():
    cat.metric("metric1").count()
Esempio 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()
Esempio 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()
Esempio n. 6
0
def test3():
    cat.metric("metric2").duration(152)
Esempio n. 7
0
def test2():
    cat.metric("metric1").count(2)
Esempio n. 8
0
def test1():
    cat.metric("metric1").count()
Esempio 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()
Esempio 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()
Esempio n. 11
0
def test3():
    cat.metric("metric2").duration(152)
Esempio n. 12
0
def test2():
    cat.metric("metric1").count(2)