orhanobut / tracklytics

✔️ Annotation based tracking handler with aspect oriented programming
Apache License 2.0
429 stars 45 forks source link

Track screen load duration #13

Closed orhanobut closed 7 years ago

orhanobut commented 8 years ago

Problem

Sometimes you may need to determine the elapsed time for a specific event. For example: Screen load time between onResume and onCreate

Proposition

Add a track timer annotation to start point with a key. Key will be used to differentiate different timer points. Thus multiple timer start point can be used. And used a specific annotation to add the attribute which gets the attribute key and the timer to determine elapsed time.

@TrackTimer("timer_id")
public void onCreate() {}

@TrackEvent("Event name")
@TrackAttribute(key="attribute", timer="timer_id")
public void onResume(){}

onResume will have an attribute which is called "attribute" and the value will be elapsed time between onCreate and onTime.

Elapsed time should use milliseconds for unit.

sirvon commented 8 years ago

does this work in the source yet?

orhanobut commented 8 years ago

No, not yet. I dropped the idea actually until I have a concrete need. Since analytic provides calculate the lead time already. Do you have any concrete example?