This file contains hidden or 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 math | |
import matplotlib | |
import matplotlib.pyplot as plt | |
def confidence_for_sampling(pop_size=1000, con_level=0.99, sample_rate=0.1): | |
if con_level not in (0.99, 0.95): | |
raise Exception("don't know those zvals") | |
zval = 1.96 if con_level == 0.95 else 2.58 | |
variance = (pop_size * sample_rate) * (1 - sample_rate) |
This file contains hidden or 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
* This software includes portions of Javassist from | |
http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/ under the Apache | |
License, Version 2.0. A copy of the Apache License is included with | |
this distribution in the file Apache-2.0.txt. | |
* This software includes portions of the Google Guava Libraries from | |
http://code.google.com/p/guava-libraries/ under the Apache License, | |
Version 2.0. A copy of the Apache License is included with this | |
distribution in the file Apache-2.0.txt. |
This file contains hidden or 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
/** | |
* Wraps RUM methods using reflection. | |
* (works even if RUM classes are unavailable.) | |
*/ | |
import java.lang.reflect.Method; | |
public class RUMWrapper { |
This file contains hidden or 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
run_simulation = function(router_mode = "naive", | |
reqs_per_minute = 9000, | |
simulation_length_in_minutes = 5, | |
dyno_count = 100, | |
choice_of_two = FALSE, | |
power_of_two = FALSE, | |
unicorn_workers_per_dyno = 0, | |
track_dyno_queues = FALSE) { | |
if(!(router_mode %in% c("naive", "intelligent"))) { |
This file contains hidden or 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 requests | |
requests.get("WABSITE 3.0") |
This file contains hidden or 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 oboe | |
except ImportError, e | |
pass | |
... | |
if 'oboe' in sys.modules: | |
oboe.log('info', None, keys={'Post-length': len(my_post_field), 'Post-data': my_post_field[0:256]}) |
This file contains hidden or 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
""" Tracelytics instrumentation API for Python. | |
Copyright (C) 2012 by Tracelytics, Inc. | |
All rights reserved. | |
""" | |
# defines no-op classes for platforms we don't support building the c extension on | |
class Metadata(object): | |
def __init__(self, _=None): | |
pass |
This file contains hidden or 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
diff --git a/oboe/__init__.py b/oboe/__init__.py | |
index ab4d176..45f7a2d 100644 | |
--- a/oboe/__init__.py | |
+++ b/oboe/__init__.py | |
@@ -3,8 +3,6 @@ | |
Copyright (C) 2012 by Tracelytics, Inc. | |
All rights reserved. | |
""" | |
-from oboe_ext import Context as SwigContext, Event as SwigEvent, UdpReporter, Metadata | |
- |
This file contains hidden or 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 | |
... |
This file contains hidden or 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 |