Skip to content

Instantly share code, notes, and snippets.

@vishalratna-microsoft
Created December 11, 2021 16:00
Show Gist options
  • Save vishalratna-microsoft/357e36a22247cdd5538332ee9d1c894c to your computer and use it in GitHub Desktop.
Save vishalratna-microsoft/357e36a22247cdd5538332ee9d1c894c to your computer and use it in GitHub Desktop.
End the tag based measurement in Activity class
override fun onCreate(savedInstanceState: Bundle?) {
var prefs = NewsApplication.get(this).getPrefs()
prefs = NewsApplication.get(this).getPrefs()
val component = NewsApplication.get(this).applicationComponent.plus(NewsFeedModule())
component.inject(this)
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_news_feed)
viewModel = ViewModelProvider(this, viewModelFactory).get(NewsFeedActivityViewModelImpl::class.java)
registerLiveDataObservers()
Snippet.find("app_launch").endCapture(); // End the measurement.
// Prints log like this for the above measurement.
// 2021-12-11 21:29:07.037 23395-23395/com.takehome.carousell D/NewsApplication: [Class = NewsFeedActivity]|::::|[Method = onCreate]|::::|<Line no. 56>|::::|[Thread name = main]|::::||::::|(176 ms)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment