Skip to content

Mobile Vitals for UI events transactions #2101

Closed as not planned
Closed as not planned

Description

@romtsn

Report slow and frozen frames for recently added UI events transactions on iOS and Android.

Activity

  1. marandaneto commented on May 12, 2022

    @marandaneto
    Contributor

    As I understood, this is already done on iOS for every transaction, since they don't need the instance of the view such as activity.

  2. changed the title [-]Metrics for UI events transactions[/-] [+]Mobile Vitals for UI events transactions[/+] on Jun 15, 2022
  3. bruno-garcia commented on Jun 15, 2022

    @bruno-garcia
    Member

    Moving to the sentry-java repo since iOS already has this.

  4. transferred this issue fromon Jun 15, 2022
  5. philippsuess commented on Jun 17, 2022

    @philippsuess

    As I understood, this is already done on iOS for every transaction, since they don't need the instance of the view such as activity.

    Yes, indeed.

  6. adinauer commented on Sep 30, 2022

    @adinauer
    Member

    Would probably need to replace ActivityFramesTracker with something based on choreographer.postFrameCallback(frameCallback) similar to what is done here

    private val frameCallback = object : Choreographer.FrameCallback {
    private var expectedFrameDurationNanos: Float = TimeUnit.SECONDS.toNanos(1) / 60F
    var frames = 0
    var droppedFrames = 0.0
    fun setup(refreshRate: Float) {
    frames = 0
    droppedFrames = 0.0
    expectedFrameDurationNanos = TimeUnit.SECONDS.toNanos(1) / refreshRate
    }
    override fun doFrame(frameTimeNanos: Long) {
    frames++
    val timeSinceLastFrameNanos = frameTimeNanos - lastFrameTimeNanos
    if (timeSinceLastFrameNanos > expectedFrameDurationNanos) {
    // Fractions of frames dropped are weighted to improve the accuracy of the results.
    // For example, 31ms between frames is much worse than 17ms, even though both
    // durations are within the "1 frame dropped" range.
    droppedFrames += timeSinceLastFrameNanos / expectedFrameDurationNanos - 1
    }
    lastFrameTimeNanos = frameTimeNanos
    choreographer.postFrameCallback(this)
    }
    }

    This would then also be helpful for FPS Mobile Vitals.

  7. markushi commented on Feb 15, 2023

    @markushi
    Member

    This is already done for Profiling, as frame metrics are already collected on a frame by frame level. It probably makes sense to refactor the existing ActivityFramesTracker and make it's collected data available to both Profiling and Transactions.

  8. markushi commented on Feb 15, 2023

    @markushi
    Member

    It could make sense to re-use the frame-by-frame profiling collector in case there isn't too much of an overhead. (SentryFramesMetricCollector)

  9. romtsn commented on Mar 6, 2024

    @romtsn
    ContributorAuthor

    this is superseded by mobile starfish and will be tackled by the mobile interfactions module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performance

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions