Skip to content

Commit

Permalink
Crawler: guppy plugin simplification
Browse files Browse the repository at this point in the history
Since we now only load the guppy plugin when the user requested it, it's
better just to toss an import error if we can't load the guppy module.
  • Loading branch information
acdha committed Sep 9, 2010
1 parent 2c57c89 commit 403b874
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions plugins/guppy_plugin.py
Expand Up @@ -2,23 +2,16 @@
import csv
import logging

LOG = logging.getLogger("crawler")
from guppy import hpy

try:
from guppy import hpy
ACTIVE = True
except:
LOG.debug('Guppy plugin not found. If you want memory profiling `pip install guppy`')
ACTIVE = False
LOG = logging.getLogger("crawler")


class Heap(Plugin):
"""
Calculate heap consumed before and after request
"""

active = False

def __init__(self, write_csv=False):
super(Heap, self).__init__()
self.heap_urls = self.data['heap_urls'] = {}
Expand Down

0 comments on commit 403b874

Please sign in to comment.