This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
from pystatsd import Client, Server | |
sc = Client('statsd.local.vm',8125) | |
while True: | |
sc.increment('python_test.inc_int') | |
time.sleep(random.random()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alerts: | |
- target: carbon.agents.*.metricsReceived | |
warning: 10 | |
crticial: 0 | |
name: Graphite Metrics Received |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import calendar | |
import json | |
import socket | |
import time | |
import requests | |
from dateutil.parser import parse | |
graphite_server = 'localhost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "/apps/production/api/virtualenvs/api/local/lib/python2.7/site-packages/tornado/ioloop.py", line 327, in start | |
self._handlers[fd](fd, events) | |
File "/apps/production/api/virtualenvs/api/local/lib/python2.7/site-packages/tornado/stack_context.py", line 190, in __call__ | |
return super(_StackContextWrapper, self).__call__(*args, **kwargs) | |
File "/apps/production/api/virtualenvs/api/local/lib/python2.7/site-packages/tornado/curl_httpclient.py", line 133, in _handle_events | |
self._finish_pending_requests() | |
File "/apps/production/api/virtualenvs/api/local/lib/python2.7/site-packages/tornado/curl_httpclient.py", line 187, in _finish_pending_requests | |
self._finish(curl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install klout-to-graphite | |
export KLOUT_KEY="YOUR KLOUT KEY" | |
cat twitter_usernames.txt | klout_to_graphite --graphite-host graphite.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66668 google | |
1830 nfl | |
1394 ayla+brown | |
855 wwe | |
775 les+miserables | |
758 stanford+football | |
724 dallas+cowboys | |
709 cheap+tickets | |
487 justin+bieber | |
486 northern+illinois+football |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export S2G_DSN="mysq://username:password@host/db" | |
cat queries.sql | sql-to-graphite --graphite-host graphite.example.com --graphite-prefix db.metrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT "metric", 1+1; | |
SELECT "now", NOW(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
import pika | |
from pika.adapters.tornado_connection import TornadoConnection | |
except ImportError: | |
pika = None | |
try: | |
import tornado | |
import tornado.ioloop | |
except ImportError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PIL import Image, ImageDraw | |
try: | |
import cv | |
except ImportError: | |
print 'Could not import cv, trying opencv' | |
import opencv.cv as cv |
OlderNewer