Beispiel #1
0
    def run(self):
        """
        Redirect bottle logging messages so it doesn't clutter the test output
        and start the web GUI.
        """
        tracker = ClassTracker()
        tracker.track_class(Trash)
        tracked_trash = Trash()
        tracker.create_snapshot()

        sys.stdout = StringIO()
        sys.stderr = StringIO()
        start_profiler(debug=True, quiet=True, tracker=tracker)
Beispiel #2
0
    def run(self):
        """
        Redirect bottle logging messages so it doesn't clutter the test output
        and start the web GUI.
        """
        tracker = ClassTracker()
        tracker.track_class(Trash)
        tracked_trash = Trash()
        tracker.create_snapshot()

        sys.stdout = StringIO()
        sys.stderr = StringIO()
        start_profiler(debug=True, quiet=True, tracker=tracker)
Beispiel #3
0
        self.mutable = list(range(10))
        self.immutable = tuple(range(10))


def create_data(tracker, iterations=20, obj_per_iteration=100):
    objects = []
    for x in range(iterations):
        for y in range(obj_per_iteration):
            objects.append(Alpha())
            objects.append(Beta())
        objects.append(Gamma())
        tracker.create_snapshot()

    return objects


tracker = ClassTracker()

tracker.track_class(Alpha)
tracker.track_class(Beta)
tracker.track_class(Gamma, trace=True, resolution_level=2)

print ("Create data")
tracker.create_snapshot()
data = create_data(tracker)
print ("Drop data")
del data
tracker.create_snapshot()

web.start_profiler(debug=True, stats=tracker.stats)
Beispiel #4
0
from pympler.garbagegraph import start_debug_garbage
from pympler import web


class Leaf(object):
    pass


class Branch(object):
    def __init__(self, root):
        self.root = root
        self.leaf = Leaf()


class Root(object):
    def __init__(self, num_branches):
        self.branches = [Branch(self) for _ in range(num_branches)]


start_debug_garbage()

tree = Root(2)
del tree
web.start_profiler(debug=True)
Beispiel #5
0
#        tracker.create_snapshot()

    return objects

tracker = ClassTracker()

tracker.track_class(Waypoint)
tracker.track_class(WaypointList)
#tracker.track_class(Gamma, trace=True, resolution_level=2)

print("Create data")
tracker.create_snapshot()
data = create_data(tracker)
print(data)
print("Drop data")
for item in data:
    del item
del data
tracker.create_snapshot()

print("Create tenfold data")
tracker.create_snapshot()
data = create_data(tracker, iterations=1000, obj_per_iteration=100)
print("Drop data")
for item in data:
    del item
del data
tracker.create_snapshot()

web.start_profiler(debug=True, stats=tracker.stats)