Chronometro


Source link: https://github.com/TV4/chronometro

Chronometro

The Chronometro plugin is a benchmarking plugin for Android Studio.

It provides the information on loading times of any kind of functionality that may be found in the Android application. Benchmarking is not a trivial task on Android when taking into account the life cycle of activities and fragments. Thus, this plugin appears to be very handy when one needs to track the completion of the network calls in relation to that.

The plugin provides the annotation that is used to mark the methods that are going to be tracked. At the same time the checkpoints are provided if one would like to have a report on loading time in a current point of execution without stopping the timer.

Chronometro is based on Aspect Oriented Programming for Android and uses the AspectJ library.

Chronometro finds its inspiration in:

Usage

Chronometro annotations are added to the methods in interest.

@Chronometro(state = Chronometro.START, name = "Fragment1") @Override public void onAttach(Activity activity) {

super.onAttach(activity);

// some code here 
}

@Chronometro(state = Chronometro.END, name = "Fragment1") @Override public void onDataSuccess(Data data) {

// some code here 
}

Example of result logs:

Chronometro --> Fragment1 started Chronometro --> Fragment1 created --> [2000ms]

One may define several timers y providing a different name value in the annotation.

The plugin provides also checkpoints so the developer can get the loading times for methods that run between the starting and ending point. Here are the two states that are available for getting the loading time right before the method runs (Chronometro.CHECKPOINT_START) and one right after (Chronometro.CHECKPOINT_END)

// logging the time until after the view has been created @Chronometro(state = Chronometro.CHECKPOINT_END, name = "Fragment1") @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {

super.onViewCreated(view, savedInstanceState);

// some code here 
}

// logging the time until before the fetching of data @Chronometro(state = Chronometro.CHECKPOINT_START, name = "Fragment1") @Override private void fetchData() {

// some code here 
}

Example of logs at the checkpoints:

  Chronometro --> Fragment1 checkpoint after method onViewCreated --> [68ms]
Chronometro --> Fragment1 checkpoint before method fetchData --> [108ms]

To integrate the plugin into your project, please add the following code to your Gradle file:

buildscript {

repositories {

  jcenter()

}
  dependencies {

classpath 'se.tv4:chronometro-plugin:0.4.0'

}
 
}
  apply plugin: 'com.android.application' apply plugin: 'chronometro'

OBS! If you are using android-data-binding in your project, make sure you have at least rc3 version.

classpath 'com.android.databinding:dataBinder:1.0-rc3'

License

Copyright 2015, TV4 AB.  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

Android Developer Icons is a custom icon set, included are:

  • 250 hand-crafted, pixel-perfect icons in 5 sizes and 14 colors
  • an icon font, made from the set
  • all sources: .svg, .ai, .eps, .eot, .ttf, .woff

Library containing common animations needed for transforming ViewPager scrolling on Android v13+. This library is a rewrite of the JazzyViewPager library and owes credit of the animation concepts directly to its source. The purpose of this rewrite is to provide an easier to use and extend implementation of ViewPager animations.

MatchView is a library which includes MatchTextView and MatchButton.

Renderers is an Android library created to avoid all the Adapter/ListView boilerplate needed to create a new adapter and all the spaghetti code that developers used to create following the ViewHolder classic implementation.

This Android library offers you two main classes to extend and create your own rendering algorithms out of your adapter implementation.

Renderers is an easy way to work with android ListView and Adapter classes. With this library you only have to create your renderers and declare the mapping between the object to render and the renderer.

Futuroid is an Android library that allows running asynchronous tasks and attaching callbacks thanks to a convenient syntax. It offers an alternative to the Android AsyncTask class.

Features:

  • Future-based API (similar to Guava's ListenableFutures, Scala/Akka Futures, Javascript promises...)
  • Allows registering callbacks to be run on the Android UI/main thread
  • Provides a default ExecutorService (fixed thread pool with 5 threads) that can be replaced by a custom one
  • Each task can be run on the default ExecutorService or on a custom one
  • Allows task chaining (monad-style)

Custom shape ImageView using PorterDuffXfermode with paint shapes and SVGs.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes