Hi, all:
I found that I can get correct response from swift proxy if I do the following modification for ceilometer/objectstore/swift_middleware.py:
class CeilometerMiddleware(object): ... def __call__(self, env, start_response): ...
def iter_response(iterable): if start_response_args[0]: start_response(*start_response_args[0]) """ bytes_sent = 0 try: for chunk in iterable: if chunk: bytes_sent += len(chunk) yield chunk finally: self.publish_sample(env, input_proxy.bytes_received, bytes_sent) """ return iterable
try: iterable = self.app(env, my_start_response) except Exception: self.publish_sample(env, input_proxy.bytes_received, 0) raise else: return iter_response(iterable)
I have no idea why the python for loop makes the response become empty. Could any one else help to check this issue?
Thanks a lot!
Hi, all:
I found that I can get correct response from swift proxy if I do the following modification for ceilometer/ objectstore/ swift_middlewar e.py:
class CeilometerMiddl eware(object) :
...
def __call__(self, env, start_response):
...
def iter_response( iterable) : args[0] :
start_ response( *start_ response_ args[0] )
bytes_ sent = 0
if chunk:
bytes_ sent += len(chunk)
yield chunk
finally:
self. publish_ sample( env,
input_ proxy.bytes_ received,
bytes_ sent)
if start_response_
"""
try:
for chunk in iterable:
"""
return iterable
try:
iterable = self.app(env, my_start_response)
self. publish_ sample( env, input_proxy. bytes_received, 0) iterable)
except Exception:
raise
else:
return iter_response(
I have no idea why the python for loop makes the response become empty.
Could any one else help to check this issue?
Thanks a lot!