Skip to content

Instantly share code, notes, and snippets.

View beltran's full-sized avatar

Jaume Marhuenda beltran

  • Google LLC
  • New York
View GitHub Profile
@beltran
beltran / socket_poc.py
Created March 7, 2017 22:26
POC for socket bug
# -*- coding: utf-8 -*-
import os
import uuid
import time
import cassandra
from cassandra import cluster as cassandra_cluster
#from cassandra.io.geventreactor import GeventConnection
# -*- coding: utf-8 -*-
import os
import uuid
import time
import dse
from dse import cluster as cassandra_cluster
#from dse.io.geventreactor import GeventConnection
@beltran
beltran / poc_many_prepared.py
Created March 9, 2017 00:19
Memory grows when using prepared queries and eventles, this is what's happening in endurance tests, because memory is all taken by the driver
# -*- coding: utf-8 -*-
import os
import uuid
import time
import dse
from dse import cluster as cassandra_cluster
#from dse.io.geventreactor import GeventConnection
# -*- coding: utf-8 -*-
import os
import uuid
import time
import dse
from dse import cluster as cassandra_cluster
#from dse.io.geventreactor import GeventConnection
# -*- coding: utf-8 -*-
import os
import uuid
import time
import cassandra
from cassandra.io.libevreactor import LibevConnection
from cassandra.cluster import Cluster
import logging
from dse_graph import DseGraph
from dse.cluster import Cluster, EXEC_PROFILE_GRAPH_DEFAULT, EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT
log = logging.getLogger()
log.setLevel('DEBUG')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s"))
log.addHandler(handler)
from cassandra.cluster import Cluster
import logging
log = logging.getLogger()
log.setLevel('INFO')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s"))
log.addHandler(handler)
from cassandra import cluster as cassandra_cluster
from cassandra.concurrent import execute_concurrent
from itertools import cycle
from threading import Event
import logging
log = logging.getLogger()
log.setLevel('ERROR')
handler = logging.StreamHandler()
from cassandra.io.eventletreactor import EventletConnection
from cassandra.io.geventreactor import GeventConnection
from cassandra.io.libevreactor import LibevConnection
from cassandra.io.asyncorereactor import AsyncoreConnection
connection_class = AsyncoreConnection
if connection_class == EventletConnection:
from eventlet import monkey_patch
monkey_patch()
from cassandra.io.eventletreactor import EventletConnection
from cassandra.io.geventreactor import GeventConnection
from cassandra.io.libevreactor import LibevConnection
from cassandra.io.asyncorereactor import AsyncoreConnection
connection_class = LibevConnection
if connection_class == EventletConnection:
from eventlet import monkey_patch
monkey_patch()