Skip to main content

Cat SDK for Python

Project description

Python SDK of CAT <https://github.com/dianping/cat>.

Installation

Install via pip:

$ pip install cat-sdk

Code Demo

import cat
import time

cat.init("appkey")

with cat.Transaction("foo", "bar") as t:
    try:
        t.add_data("hello")
        t.add_data("foo", "bar")
        cat.log_event("hook", "before")
        # do something
    except Exception as e:
        cat.log_exception(e)
    finally:
        cat.metric("api-count").count()
        cat.metric("api-duration").duration(100)
        cat.log_event("hook", "after")
time.sleep(1)

Documentation

Please check Github for more information.

Changelog

https://github.com/dianping/cat/blob/master/lib/python/CHANGELOG.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cat-sdk-3.1.2.tar.gz (250.3 kB view details)

Uploaded Source

File details

Details for the file cat-sdk-3.1.2.tar.gz.

File metadata

  • Download URL: cat-sdk-3.1.2.tar.gz
  • Upload date:
  • Size: 250.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10

File hashes

Hashes for cat-sdk-3.1.2.tar.gz
Algorithm Hash digest
SHA256 1d015b5030501a25d59e5a95efb9a728d86533da8bccbb84ce479a938d8af42c
MD5 083493110f4327ca650f16f96b3187a8
BLAKE2b-256 870c1eeb2247947ae0ab8d5a38dff70d326f8be7478cee15591f0e62ab2f2596

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page