disable db handlers, update config

This commit is contained in:
Tim Daly, Jr
2013-04-10 04:07:43 +00:00
parent 1947238e6c
commit 396fed66c0
3 changed files with 26 additions and 19 deletions

View File

@@ -44,6 +44,7 @@ def send(span):
ip = '0.0.0.0' ip = '0.0.0.0'
return zipkin_thrift.Endpoint(ipv4 = ip_to_i32(ip), return zipkin_thrift.Endpoint(ipv4 = ip_to_i32(ip),
port = note.port, port = note.port,
service_name = note.service_name) service_name = note.service_name)
def annotation(note): def annotation(note):
return zipkin_thrift.Annotation(timestamp = int(note.time * 1e6), return zipkin_thrift.Annotation(timestamp = int(note.time * 1e6),
@@ -55,13 +56,20 @@ def send(span):
name = span.name, name = span.name,
parent_id = span.parent_id, parent_id = span.parent_id,
annotations = [annotation(n) for n in span.notes]) annotations = [annotation(n) for n in span.notes])
print "zspan is {0}".format(zspan)
out = StringIO.StringIO() out = StringIO.StringIO()
raw = TBinaryProtocol.TBinaryProtocolAccelerated(out) raw = TBinaryProtocol.TBinaryProtocolAccelerated(out)
zspan.write(raw) try:
zspan.write(raw)
except OverflowError:
traceback.print_exc()
scribe_sender.send('zipkin', base64.b64encode(out.getvalue())) scribe_sender.send('zipkin', base64.b64encode(out.getvalue()))
def ip_to_i32(ip_str): def ip_to_i32(ip_str):
"""convert an ip address from a string to a signed 32-bit number""" """convert an ip address from a string to a signed 32-bit number"""
return -0x80000000 + (IPy.IP(ip_str).int() & 0x7fffffff) a = -0x80000000 + (IPy.IP(ip_str).int() & 0x7fffffff)
if not -2147483648 <= a <= 2147483647:
print "ARGARG {0}".format(a)
return a

View File

@@ -18,6 +18,18 @@ enabled_backends = ['tomograph.backends.zipkin',
'tomograph.backends.log'] 'tomograph.backends.log']
backend_modules = [] backend_modules = []
zipkin_host = '127.0.0.1'
zipkin_port = 1463
statsd_host = 'pairsscares.corp.gq1.yahoo.com'
statsd_port = 8125
zipkin_socket_timeout = 5.0
zipkin_max_queue_length = 50000
zipkin_target_write_size = 1000
debug = False
def set_backends(backends): def set_backends(backends):
""" """
Set the list of enabled backends. Backend name should be the full Set the list of enabled backends. Backend name should be the full
@@ -44,17 +56,3 @@ def get_backends():
set_backends(enabled_backends) set_backends(enabled_backends)
return backend_modules return backend_modules
zipkin_host = '127.0.0.1'
zipkin_port = 1463
# zipkin_port = 9410
#statsd_host = '127.0.0.1'
statsd_host = 'pairsscares.corp.gq1.yahoo.com'
statsd_port = 8125
zipkin_socket_timeout = 5.0
zipkin_max_queue_length = 50000
zipkin_target_write_size = 1000
debug = False

View File

@@ -103,13 +103,14 @@ def before_execute(name):
port = conn.connection.connection.port port = conn.connection.connection.port
#print >>sys.stderr, 'connection is {0}:{1}'.format(h, port) #print >>sys.stderr, 'connection is {0}:{1}'.format(h, port)
#print >>sys.stderr, 'sql statement is {0}'.format(clauseelement) #print >>sys.stderr, 'sql statement is {0}'.format(clauseelement)
start(str(name) + 'db client', 'execute', h, port) #start(str(name) + 'db client', 'execute', h, port)
return handler return handler
def after_execute(name): def after_execute(name):
# name isn't used, at least not yet... # name isn't used, at least not yet...
def handler(conn, clauseelement, multiparams, params, result): def handler(conn, clauseelement, multiparams, params, result):
stop('execute') #stop('execute')
pass
return handler return handler
## http helpers ## http helpers