Skip to content

Cancel/Discard Started Performance Custom Traces 🚀 #4866

@PiotrBandurski

Description

@PiotrBandurski

What feature would you like to see?

Possibility to discard/cancel custom Firebase Performance trace. Currently we can only start and stop trace which always will track time. eg.

val myTrace = Firebase.performance.newTrace("test_trace")
myTrace.start()

// code that you want to trace

myTrace.stop()

But if for some reason I want to discard started trace
(example scenario: I want to trace how long app fetches data from api but some error occurs and I don't want to track partially downloaded data).
I cannot do it and I have to live with started trace which takes memory on device.

How would you use it?

I think adding method Trace#cancel() which under the hood will unsubscribe from all observations would be best solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions