Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mobile app profiling metrics #7660

Merged
merged 14 commits into from
Sep 20, 2023
Merged
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Mobile App Profiling
sidebar_order: 3
sidebar_order: 50
redirect_from:
- /profiling/mobile-app-profiling
description: "Get started with Mobile App Profiling, which allows you to see code-level profiling information for your mobile apps."
---

Expand Down
29 changes: 29 additions & 0 deletions src/docs/product/profiling/mobile-app-profiling/metrics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Metrics
sidebar_order: 50
redirect_from:
- /profiling/mobile-app-profiling/metrics/
description: "Measurements taken by the Sentry profiler that help us contextualize the work your mobile app does and detect possible issues impacting performance."
---

The Sentry profiler records several system measurements to help analyze the backtraces it gathers. Some, like CPU and heap usage, are taken on a regular sampling interval using functions from `mach/mach.h`, albeit with a lower frequency than backtrace sampling. Others, like GPU information, are taken from `CADisplayLink` callback invocations, as they're received.

## CPU Usage

The amount of CPU used by the app process, (as a scaled percentage of total CPU capacity, which varies depending on the number of cores), is measured every 100 ms. The value is calculated using `thread_info` with `THREAD_BASIC_INFO`, which returns a CPU usage value per thread and sums up the values for all current threads.

## Heap Usage

The amount of heap memory used by the application is recorded every 100 ms using `task_info` with `TASK_VM_INFO`.

## GPU Information

In addition to counting the number of [slow and frozen UI frame renders](/product/performance/mobile-vitals/#slow-and-frozen-frames) for Mobile Vitals, Sentry now records the timestamp for every frame and overlays it on top of profiling flame charts:

![Sentry displays slow and frozen frames above the flamechart of a particular profile.](./flamechart-with-gpu-overlay.png)

The profiler records the current frame rate upon start, and then any time it changes, (for example if a user puts their device into low-power mode).

## Energy Usage

The amount of energy expended by CPU work allocated to the app process is calculated every 100 ms using `task_info` with `TASK_POWER_INFO_V2`.
Loading