From e9803f7371f4999251c3419004337c65b0050596 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Oct 2020 08:57:26 -0500 Subject: [PATCH] Add profiler integration (#14856) --- source/_integrations/profiler.markdown | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 source/_integrations/profiler.markdown diff --git a/source/_integrations/profiler.markdown b/source/_integrations/profiler.markdown new file mode 100644 index 00000000000..6ffad5a8b7b --- /dev/null +++ b/source/_integrations/profiler.markdown @@ -0,0 +1,35 @@ +--- +title: Profiler +description: Profile Home Assistant. +ha_category: + - Utility +ha_release: 0.117 +ha_quality_scale: internal +ha_domain: profiler +--- + +The Profiler integration provides a profile which is a set of statistics that identifies how much time each part of Home Assistant is taking. It can help track down a performance issue or provide insight about a misbehaving integration. + +## Configuration + +To add `Profiler` to your installation, go to **Configuration** >> **Integrations** in the UI, click the button with `+` sign and from the list of integrations select **Profiler**. + +### Service `profiler.start` + +Start the profiler for the specified number of seconds. + +| Service data attribute | Optional | Description | +| ---------------------- | -------- | ----------- | +| `seconds` | yes | The number of seconds to run the profile. Defaults to 60.0 + +When the profile is complete, Profiler will generate a Python `cprof` and a `callgrind.out` file in your configuration directory. The exact path to these files will appear in a persistent notification so they can be easily located and copied to your desktop. + +The `cprof` file can be viewed with: + +[SnakeViz](https://jiffyclub.github.io/snakeviz/) +[Gprof2dot](https://github.com/jrfonseca/gprof2dot) + +Additionally, the profiler will generate a `callgrind.out` file that can be viewed with: + +[kcachegrind](https://kcachegrind.github.io/) or qcachegrind +