def test_load(self): fg = FlameGraph() fg.load( os.path.join(os.path.dirname(__file__), "data/multithread.json")) ofile = "result_flamegraph.html" fg.save(ofile) self.assertTrue(os.path.exists(ofile)) os.remove(ofile)
def test_load(self): fg = FlameGraph() fg.load(os.path.join(os.path.dirname(__file__), "data/multithread.json")) for tree in fg._data.values(): self.assertEqual(depth(tree), 5) ofile = "result_flamegraph.html" fg.save(ofile) self.assertTrue(os.path.exists(ofile)) os.remove(ofile)
def test_basic(self): with open(os.path.join(os.path.dirname(__file__), "data/multithread.json")) as f: sample_data = json.loads(f.read()) fg = FlameGraph(sample_data) trees = fg.parse(sample_data) for tree in trees.values(): self.assertEqual(depth(tree), 5) ofile = "result_flamegraph.html" fg.save(ofile) self.assertTrue(os.path.exists(ofile)) os.remove(ofile)