def ppstats(self):
        if not _profiling_enabled:
            print ("*** MDF profiling not enabled ***\n" +
                   "Use the --mdf-profile command line option " +
                   "to enable profiling")
            return

        ctx = cython.declare(MDFContext)

        nodes_without_value = set(_all_nodes.itervalues())
        nodes_with_value = set()

        all_timers = {}
        num_shifts = len(self.get_shifted_contexts())

        for ctx in itertools.chain([self], self.get_shifted_contexts()):
            for node in list(nodes_without_value):
                if node.has_value(ctx):
                    nodes_with_value.add(node)
                    nodes_without_value.remove(node)

            for obj, timer in ctx._timers.iteritems():
                if isinstance(obj, MDFNodeBase):
                    name = obj.name
                elif hasattr(obj, "__name__"):
                    name = "<%s 0x%x>" % (obj.__name__, id(obj))
                elif hasattr(obj, "__class__"):
                    name = "<%s 0x%x>" % (obj.__class__.__name__, id(obj))
                else:
                    name = str(obj)

                all_timers.setdefault(name, []).append(timer)

        def timers_total_time(x):
            _, timers = x
            return sum([t.total_time for t in timers])

        all_timers = all_timers.items()
        all_timers.sort(key=timers_total_time)

        total_time = 0.0
        for name, timers in all_timers:
            node_num_calls = sum([t.num_calls for t in timers])
            node_total_time = sum([t.total_time for t in timers])
            print name
            print "    Num Calls: %d" % node_num_calls
            print "    Total Time: %f" % node_total_time
            print
            total_time += node_total_time

        print "Number of nodes: %s" % len(nodes_with_value)
        print "Number of shifted contexts: %s" % num_shifts
        print "Total Time: %f" % total_time
get a struct defining a host
dataset/ETHPy150Open manahl/mdf/mdf/context.py/MDFContext.ppstats--crossover with--dataset/ETHPy150Open marineam/nagcat/python/nagcat/nagios_api.py/NagiosXMLRPC.xmlrpc_getHost