| Python-Statsd Een klant voor Etsy's Node-JS STATSD-server |
Download nu |
Python-Statsd Rangschikking & Samenvatting
- Naam uitgever:
- Rick van Hattem
- Uitgever website:
- https://github.com/WoLpH/
Python-Statsd Tags
Python-Statsd Beschrijving
Een klant voor Etsy's Node-JS STATSD-server Statsd is een Python-client voor Etsy's Statsd-server, een front-end / proxy voor de grafietstatistiekencollectie en grafische server.- Graphite http: //graphite.wikidot.com- Statsd Code: https://github.com/etsy/statsd Blog Post: http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/install: To Install Simply Python Setup.py installeren. Als u de tests eerst wilt uitvoeren, voert u Python Setup.py Nosetestsusage uit: om heel snel te beginnen, probeer gewoon zoiets: Basic Usagetimers >>> Import Statsd >>> >>> Timer = Statsd.timer ('MyApplication' ) >>> >>> timer.start () >>> # doe hier iets >>> timer.stop ('soms') tellers >>> import statsd >>> >>> teller = statds.counter ('myApplication ') >>> # Doe iets hier >>> Counter + = 1 gevindigd gebruik >>> Import Statsd >>> >>> # Open een verbinding met `server` op poort` 1234` met een `50%` sample tarief> >> Statsd_Connection = Statsd.Connection (... Naam = 'Server', ... Poort = 1234, ... Sample_rate = 0.5, ...) >>> >>> # Maak een client voor deze applicatie >> > StatsD_Client = Statsd.client (__ Naam__, Statsd_Connection) >>> >>> KLASSE SOMECLASS (Object): ... Def __init __ (Zelf): ... # Creëer een clientspecifiek voor deze klasse ... self.statsd_client = statds_client.get_client (... Zelf .__ Klasse __.__ Naam__) ... ... Def Do_Something (Self): ... # Maak een `timer` client ... timer = self.statsd_clien t.get_client (class_ = statsd.timer) ... ... # Start de meting ... timer.start () ... ... # Doe iets ... timer.interval ('Intermediate_value') .. . ... # Doe iets anders ... timer.stop ('totaal') vereisten: · Python
Python-Statsd Gerelateerde software