Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __rungprof2dot(self):
"""Runs gprof2dot which produces a full dot spec"""
nodeLimit = Settings().getProfilerSettings().nodeLimit
edgeLimit = Settings().getProfilerSettings().edgeLimit
with io.StringIO() as buf:
gprofParser = gprof2dot.PstatsParser(self.__dataFile)
profileData = gprofParser.parse()
profileData.prune(nodeLimit / 100.0, edgeLimit / 100.0, False, False)
dot = gprof2dot.DotWriter(buf)
dot.strip = False
dot.wrap = False
dot.graph(profileData, gprof2dot.TEMPERATURE_COLORMAP)
output = buf.getvalue()
return self.__postprocessFullDotSpec(output)
def _create_profile(source, get_filename=_temp_file_from_file_field):
"""
Parse a profile from a django file field source.
"""
with get_filename(source) as filename:
return PstatsParser(filename).parse()
function.module = os.path.basename(module)
function[SAMPLES] = 0
function[TOTAL_SAMPLES] = 0
self.profile.add_function(function)
return function, None
formats = {
"axe": AXEParser,
"callgrind": CallgrindParser,
"hprof": HProfParser,
"json": JsonParser,
"oprofile": OprofileParser,
"perf": PerfParser,
"prof": GprofParser,
"pstats": PstatsParser,
"sleepy": SleepyParser,
"sysprof": SysprofParser,
"xperf": XPerfParser,
"dtrace": DtraceParser,
}
########################################################################
# Output
class Theme:
def __init__(self,
bgcolor = (0.0, 0.0, 1.0),
mincolor = (0.0, 0.0, 0.0),