firebase / firebase/firebase-android-sdk
Cancel/Discard Started Performance Custom Traces 🚀
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 710
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 34
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.