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 mechanize | |
import urllib | |
BASE_URL = 'http://my-reddit' | |
THREAD = BASE_URL + '/r/reddit/particular-thread' | |
class Transaction(object): | |
def __init__(self): | |
self.user = 'redditor' | |
self.pass = 'password' |
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
# init trace | |
evt = oboe.Context.startTrace() | |
evt.addInfo('Layer', func.__module__) | |
evt.addInfo('Label', 'entry') | |
evt.addInfo('HTTP-Host', socket.gethostname()) | |
evt.addInfo('URL', '/%s/%s' % (func.__module__.replace('.', '/'), func.__name__)) | |
evt.addInfo('Layer-Type', 'lang') | |
oboe.reporter().sendReport(evt) | |
try: |
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
(venv)dan@dev1:~/code/oboe/test[master]$ cat !$ | |
cat test_python.py | |
""" Tests for Python high-level API. | |
No stack needed! | |
""" | |
from test import TestWebInstrumentation | |
from udplisten import get_events, get_trace, get_events_and_response | |
import oboe |
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 oboe | |
from oboeware import loader | |
# load monkey-patched instrumentation for supported modules | |
loader.load_inst_modules() | |
# trace every unit of work done by decorated method | |
# (use fractional sample rate to trace a fraction of calls to decorated method) | |
oboe.config['tracing_mode'] = 'always' | |
oboe.config['sample_rate'] = 1.0 |
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
(venv)dan@dev1:~/code/tracelons/tracelytics/selenium[master]$ time SELENIUM_INI=../selenium-prod.ini SELENIUM_DOMAIN=tracelytics.com SELENIUM_CUSTOMER=internal ./run.py test_onboarding.py | |
Test load for step one. ... ok | |
Test load for welcome page. ... ok | |
Test load for step three. ... ok | |
Test load and ajax for onboarding step 1, no hosts. ... FAIL | |
Test load for step two. ... ok | |
Test load and ajax for onboarding step 2, no layers ... FAIL | |
Test load and ajax for onboarding step 2, with layers. ... FAIL | |
Test load and ajax for onboarding step 1, with hosts. ... FAIL | |
Test load and ajax for onboarding step 3, with fewer than 5 traces. ... FAIL |
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
dan@ponderous:~/code/oboeware $ git diff | |
diff --git a/oboeware/djangoware.py b/oboeware/djangoware.py | |
index ae1d0aa..2c56c02 100644 | |
--- a/oboeware/djangoware.py | |
+++ b/oboeware/djangoware.py | |
@@ -41,13 +41,15 @@ class OboeDjangoMiddleware(object): | |
def process_request(self, request): | |
import oboe | |
+ import 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
$ date; sudo date `date +"%m%d%H%M%C%y.%S"`; date; |
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
""" Tests for rails. | |
Setup and start information in rails3-stack/run.py. | |
""" | |
from test import TestWebInstrumentation | |
from udplisten import get_events, get_trace | |
class TestRails(TestWebInstrumentation): | |
def test_index(self): |
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 eventlet as e | |
import oboe | |
s = e.greenthread.spawn | |
s = oboe.log_method(s, 'spawn', entry_kvs={'Async': True}) # or possible None for layer | |
e.greenthread.spawn = s |
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
(venv)dan@dev1:~/$ python | |
Python 2.7.2 (default, Apr 20 2012, 16:27:51) | |
[GCC 4.6.1] on linux3 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import itertools | |
>>> s = [1,2,3,4,5,6] | |
>>> combos = itertools.combinations(s, 3) | |
>>> for c in combos | |
... print c | |
... |
OlderNewer