Skip to content

Commit

Permalink
minor fix to spider closed count stat
Browse files Browse the repository at this point in the history
pablohoffman committed May 18, 2011
1 parent cd85c12 commit a98e9e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scrapy/contrib/corestats.py
Original file line number Diff line number Diff line change
@@ -30,12 +30,11 @@ def __init__(self):
def stats_spider_opened(self, spider):
stats.set_value('start_time', datetime.datetime.utcnow(), spider=spider)
stats.set_value('envinfo/host', stats.get_value('envinfo/host'), spider=spider)
stats.inc_value('spider_count/opened')

def stats_spider_closing(self, spider, reason):
stats.set_value('finish_time', datetime.datetime.utcnow(), spider=spider)
stats.set_value('finish_status', 'OK' if reason == 'finished' else reason, spider=spider)
stats.inc_value('spider_count/%s' % reason, spider=spider)
stats.inc_value('spiders_closed_count/%s' % reason)

def item_scraped(self, item, spider):
stats.inc_value('item_scraped_count', spider=spider)

0 comments on commit a98e9e0

Please sign in to comment.