sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

`HealthStats` measurements

Open marandaneto opened this issue 3 years ago • 4 comments

Description

Investigate if HealthStats fits the concept of our own measurements set in the transaction. https://developer.android.com/reference/android/os/health/HealthStats If those measurements can be measured within a transaction, maybe we can send them by default as well.

marandaneto avatar Nov 15 '22 19:11 marandaneto

Let's investigate if this is useful for us

markushi avatar Nov 17 '22 13:11 markushi

HealthStats provide several classes of data (only for Android N: api 24+): UidHealthStats, PidHealthStats, PackageHealthStats , ProcessHealthStats, and ServiceHealthStats A snapshot of the current measurements can be retrieved with SystemHealth.takeMyUidSnapshot() We could get the snapshot when a transaction starts and another when the transaction finishes, then compare the results.

There are really a lot of possible values we could get (visit links above for them), like how long the flashlight was used, how many foreground activities are spawn and how long they took, how long the process was in background, how much data was sent or received via bluetooth or wifi, time spent by the process with screen off, how many anrs or crashes there were, time spent in user space or in kernel, etc. Not all of them are always available, but there are definitely interesting things

stefanosiano avatar Dec 13 '22 18:12 stefanosiano

Investigation is done, need to take results to planning and create issues for implementation.

kahest avatar Jan 11 '23 14:01 kahest

This has already been planned for Q1 (or maybe Q2), so we just assigned the labels and priority and eventually gonna implement it.

romtsn avatar Jan 25 '23 15:01 romtsn