Skip to content
View gist:af82d281e618074ca8a6
import time
import uuid
import yappi
import timeit
import logging
import random
from threading import Event
from cassandra import ConsistencyLevel
from cassandra.cluster import Cluster
View gist:060b8a801e9545053bce
Tracing session: 43c34fb0-f054-11e4-8ca4-b9a936855b1e
activity | timestamp | source | source_elapsed
---------------------------------------------------------------------------------------------------------+----------------------------+---------------+----------------
Execute CQL3 query | 2015-05-01 15:49:03.275000 | 10.128.36.179 | 0
Parsing select * from hour_response where survey_id=100326883 and hour_created=1; [SharedPool-Worker-1] | 2015-05-01 15:49:03.277000 | 10.128.36.179 | 110
Preparing statement [SharedPool-Worker-1] | 2015-05-01 15:49:03.277000 | 10.128.36.179 | 275
Sending message to /10.128.36.193 [WRITE-/10.128.36.193] | 2015-05-01 15:49:03.278000
View gist:0f65e71401fadd1293ea
import time
import uuid
from functools import partial
from cassandra.cluster import Cluster
from multiprocessing import Pool, Queue, Process, Manager
from threading import Event
from cassandra.query import dict_factory, tuple_factory
from cassandra.cluster import PagedResult
from cassandra.io.libevreactor import LibevConnection
View gist:d6fa3fc1b6d085ad3fa4
DESCRIBE schema
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
CREATE TABLE test.response (
survey_id int,
hour_created int,
respondent_id int,
date_created text,
date_deleted text,
View gist:542f13307ef9679c0094
import time
import uuid
from cassandra.cluster import Cluster
from multiprocessing import Pool, Queue, Process, Manager
from threading import Event
from cassandra.cluster import Cluster
from cassandra.query import dict_factory
from cassandra.cluster import PagedResult
start_time = time.time()
View gist:4ca95f5c5aa539663eaf
import time
import uuid
from threading import Event
from cassandra.cluster import Cluster
from cassandra.query import dict_factory
start_time = time.time()
c = Cluster(['127.0.0.1'])
s = c.connect('test')
s.row_factory = dict_factory
View gist:e58c1cf82931e1478cd2
import sys
import StringIO
import urlparse
import cgi
from docutils import io, readers
from docutils.core import publish_doctree, Publisher
from docutils.transforms import TransformError
ALLOWED_SCHEMES = '''file ftp gopher hdl http https imap mailto mms news nntp
View gist:304e0a3675cefcc52960
# Pyramid 1.5 and lower
Name Pattern View
---- ------- ----
debugtoolbar /_debug_toolbar/*subpath <function decorator at 0x349a398>
__static/ /static/*subpath <function <pyramid.static.static_view object at 0x3421890> at 0x349a758>
__static2/ /static2/*subpath <function <pyramid.static.static_view object at 0x3421950> at 0x349a9b0>
__pdt_images/ /pdt_images/*subpath <function <pyramid.static.static_view object at 0x3421a50> at 0x349ab90>
a / None
no_view_attached / None
route_and_view_attached / <function route_and_view_attached at 0x349f050>
View gist:7ac0a1bc323784cacba8
from wsgiref.simple_server import make_server
from wsgiref.util import application_uri
import sys
import json
def home():
return 'hello world'
View fdserver.py
#!/usr/bin/env python
"""This is a demonstration of sharing file descriptors across processes.
It uses Tornado (need a recent post-2.0 version from github) and the
multiprocessing module (from python 2.6+). To run it, start one copy
of fdserver.py and one or more copies of testserver.py (in different
terminals, or backgrounded, etc). Fetch http://localhost:8000 and
you'll see the requests getting answered by different processes (it's
normal for several requests to go to the same process under light
load, but under heavier load it tends to even out).
Something went wrong with that request. Please try again.