Skip to content

Commit

Permalink
Allow for inline show_all in html output
Browse files Browse the repository at this point in the history
  • Loading branch information
dwight authored and dwight committed Nov 21, 2023
1 parent f53b97e commit 2f76774
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyinstrument/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,19 @@ def output_text(
)
)

def output_html(self, timeline: bool = False) -> str:
def output_html(self, timeline: bool = False, show_all: bool = False) -> str:
"""
Return the profile output as HTML, as rendered by :class:`HTMLRenderer`
"""
return self.output(renderer=renderers.HTMLRenderer(timeline=timeline))
return self.output(renderer=renderers.HTMLRenderer(timeline=timeline, show_all=show_all))

def write_html(self, path: str | os.PathLike[str], timeline: bool = False):
def write_html(self, path: str | os.PathLike[str], timeline: bool = False, show_all: bool = False):
"""
Writes the profile output as HTML to a file, as rendered by :class:`HTMLRenderer`
"""
file = Path(path)
file.write_text(
self.output(renderer=renderers.HTMLRenderer(timeline=timeline)),
self.output(renderer=renderers.HTMLRenderer(timeline=timeline, show_all=show_all)),
encoding="utf-8",
)

Expand Down

0 comments on commit 2f76774

Please sign in to comment.