Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
tracer_demo Namespace Reference

Classes

class  TracerDelegate
class  Tracer

Functions

def MakeTracer
def test

Variables

tuple p = profile.Profile()
dictionary getters = {}
dictionary setters = {}

Function Documentation

def tracer_demo.MakeTracer (   ob)

Definition at line 87 of file tracer_demo.py.

00087 
00088 def MakeTracer(ob):
00089     # In some cases we may be asked to wrap ourself, so handle that.
00090     if isinstance(ob, Tracer):
00091         return ob
00092     return Tracer(ob)

Definition at line 93 of file tracer_demo.py.

00093 
00094 def test():
00095     import xpcom.server, xpcom.components
00096     xpcom.server.tracer = MakeTracer
00097     contractid = "Python.TestComponent"
00098     for i in range(100):
00099         c = xpcom.components.classes[contractid].createInstance().queryInterface(xpcom.components.interfaces.nsIPythonTestInterface)
00100         c.boolean_value = 0
00101         a = c.boolean_value
00102         c.do_boolean(0,1)
00103     print "Finshed"
00104     p.print_stats()
00105     print "%-30s%s" % ("Attribute Gets", "Number")
00106     print "-" * 36
00107     for name, num in getters.items():
00108         print "%-30s%d" % (name, num)
00109     print "%-30s%s" % ("Attribute Sets", "Number")
00110     print "-" * 36
00111     for name, num in setters.items():
00112         print "%-30s%d" % (name, num)
00113 
00114 test()

Variable Documentation

Definition at line 49 of file tracer_demo.py.

tuple tracer_demo.p = profile.Profile()

Definition at line 48 of file tracer_demo.py.

Definition at line 50 of file tracer_demo.py.