import time
import datetime
import Queue
-import bunch
import sys
pass
elif response.status < 200 or response.status >= 400:
error = True
- self.q.put(bunch.Bunch({'t': now, 'o': request, 'i': response, 'e': error}))
+ self.q.put({'t': now, 'o': request, 'i': response, 'e': error})
def clear(self):
with self.q.mutex:
self.q.queue.clear()
while not self.q.empty():
j = self.q.get()
bytes_out = 0
- if 'Content-Length' in j.o.headers:
- bytes_out = int(j.o.headers['Content-Length'])
+ if 'Content-Length' in j['o'].headers:
+ bytes_out = int(j['o'].headers['Content-Length'])
bytes_in = 0
- if 'content-length' in j.i.msg.dict:
- bytes_in = int(j.i.msg.dict['content-length'])
+ if 'content-length' in j['i'].msg.dict:
+ bytes_in = int(j['i'].msg.dict['content-length'])
log.info('RL: %s %s %s bytes_out=%d bytes_in=%d failed=%r'
- % (cat, bucket, user, bytes_out, bytes_in, j.e))
+ % (cat, bucket, user, bytes_out, bytes_in, j['e']))
if add_entry == None:
add_entry = self.adder
- add_entry(cat, bucket, user, bytes_out, bytes_in, j.e)
+ add_entry(cat, bucket, user, bytes_out, bytes_in, j['e'])
def create_presigned_url(conn, method, bucket_name, key_name, expiration):
return conn.generate_url(expires_in=expiration,