scraper_q: Add timer to embedly oEmbed API call.

This gives us visibility on the response times of the embedly API which
can help debugging when the scraper_q is slow.
This commit is contained in:
Neil Williams
2015-04-13 12:16:17 -07:00
parent 21ab74fb57
commit 1397fd661a

View File

@@ -565,7 +565,12 @@ class _EmbedlyScraper(Scraper):
param_dict.update(self.embedly_params)
params = urllib.urlencode(param_dict)
timer = g.stats.get_timer("providers.embedly.oembed")
timer.start()
content = requests.get(self.EMBEDLY_API_URL + "?" + params).content
timer.stop()
return json.loads(content)
def _make_media_object(self, oembed):