cc-1799 : Filesystem

adding timing, finding request to localhost taking 250-500ms too slow.
This commit is contained in:
Naomi Aro 2011-06-24 14:50:32 +02:00
parent 59a11663cf
commit a376413737
1 changed files with 6 additions and 0 deletions

View File

@ -366,6 +366,8 @@ class AirTimeApiClient(ApiClientInterface):
response = None
try:
start = time.time()
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_media_url"])
url = url.replace("%%api_key%%", self.config["api_key"])
url = url.replace("%%mode%%", mode)
@ -375,6 +377,10 @@ class AirTimeApiClient(ApiClientInterface):
response = urllib2.urlopen(req).read()
response = json.loads(response)
elapsed = (time.time() - start)
logger.info("time taken to get response %s", elapsed)
logger.info("update media %s", response)
if(is_record):