Gradle plugin to add clock trackings to your dagger components and subcomponents

Overview

Dagger Track

A gradle plugin that automatically adds clock tracking for your components and subcomponents.

Features

DaggerTrack will tell you following type of time for each of your component and subcomponent injection:

  1. Total time: This is the total wall clock time took by the component or subcomponent injection.
  2. On CPU time: CPU time is the time the inject method took working on cpu.
  3. Off CPU time: Off CPU time is the time that inject method took when it was not running on the CPU which means it was doing some I/O work or maybe blocked on some other resource.

Getting Started

For guide and usage please visit Project Website.

License

Copyright 2020 Amanjeet Singh

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.
You might also like...
Small training project where dagger, dagger hilt and other components are used for clean architecture
Small training project where dagger, dagger hilt and other components are used for clean architecture

LeagueNow 🏆 LeagueNow is a sample soccer team list Android application 📱 built to demonstrate use of modern Android development tools - (Kotlin, Arc

Gradle Replace In Place (GRIP): a gradle plugin to update your documentation or any file with a simple gradle task

GRIP (Gradle Replace In-Place) A gradle tool to update some values in your (documentation) files by running a task. (inspired by Knit) Directives Inse

 🍲Foodium is a sample food blog Android application 📱 built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, Flow, Dagger 2/Hilt, Architecture Components, MVVM, Room, Retrofit, Moshi, Material Components).  🍲Foodium is a sample food blog Android application 📱 built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, Flow, Dagger 2/Hilt, Architecture Components, MVVM, Room, Retrofit, Moshi, Material Components).
Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects

Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects. Former: kotlin-ir-plugin-adapter-gradle

gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project

plugin-yml is a simple Gradle plugin that generates the plugin.yml plugin description file for Bukkit plugins, bungee.yml for Bungee plugins or nukkit.yml for Nukkit plugins based on the Gradle project. Various properties are set automatically (e.g. project name, version or description) and additional properties can be added using a simple DSL.

Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).

GradleMavenPush Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Cen

A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

A Gradle plugin to easily publish library components to Maven.
A Gradle plugin to easily publish library components to Maven.

Component Publisher A Gradle plugin to easily publish components based on maven-publish. You can find the latest released plugin on Gradle Plugin Port

Android Alarm Clock Plugin for Flutter.
Android Alarm Clock Plugin for Flutter.

Android Alarm Clock Plugin for Flutter This plugin allows Flutter apps to operate with the default clock application when the platform is Android. Pro

A set of helper classes for using dagger 1 with Android components such as Applications, Activities, Fragments, BroadcastReceivers, and Services.

##fb-android-dagger A set of helper classes for using dagger with Android components such as Applications, Activities, Fragments, BroadcastReceivers,

Multi module architecture Android template project using MVVM, Dagger-Hilt, and Navigation Components
Multi module architecture Android template project using MVVM, Dagger-Hilt, and Navigation Components

ModularAppTemplate An Android template project following a multi module approach with clean architecture. It has been built following Clean Architectu

Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components
Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components

ModularDynamicFeatureHilt An Android template project following a multi module approach with clean architecture. It has been built following Clean Arc

Comments
  • Refactor daggertrack tests

    Refactor daggertrack tests

    Proposed Changes

    Refactored test cases for DaggerTrack due to the following reasons:

    • Over mocking of the classes leading to over specifications in test cases.
    • Some of the tests were highly coupled with Gradle API for example ClassPoolFactoryTest
    • No functional tests for dagger track plugin
    • Due to lack of functional test reliability on test suite was highly reduced
    • Adding more tests was becoming a pain when we rely more on mocking.
    • Added GradleTestRunner class which helps you to set up a minimal project which can help to set up the environment of tests easily.

    Testing

    Have refactored all the test cases mostly.

    • [x] ClassPoolFactoryTest
    • [x] CtClassTransformationsTest
    • [x] ClassPoolTransformationsTest
    • [x] Added new DaggerTrackPluginTest

    Issues Fixed

    opened by amanjeetsingh150 0
  • Nothing in logcat

    Nothing in logcat

    I add all that you write in the manual:

    maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }

    dependencies { classpath "me.amanjeet.daggertrack:dagger-track:1.0.5-SNAPSHOT" }

    apply plugin: 'com.android.application'

    apply plugin: 'me.amanjeet.daggertrack'

    daggerTrack { applyFor = ["debug"] }

    implementation 'me.amanjeet.daggertrack:dagger-track-clocks:1.0.5-SNAPSHOT'

    All in the right places.

    I expect that I automatically see the output in logcat if I filter DaggerTrack. I force stop app and run but there is no DaggerTrack in logcat.

    I have to do something else?

    Thanks for answer

    opened by drdla49 5
  • Unknown source for `java.lang.Object` logs given by dagger track

    Unknown source for `java.lang.Object` logs given by dagger track

    D/DaggerTrack: Total On CPU time of me.amanjeet.daggertrack.ui.HomeFragment: 2940ms
    D/DaggerTrack: Total Off CPU time of me.amanjeet.daggertrack.ui.HomeFragment: 4547ms
    D/DaggerTrack: Total time of java.lang.Object: 7487ms
    D/DaggerTrack: Total On CPU time of java.lang.Object: 2940ms
    D/DaggerTrack: Total Off CPU time of java.lang.Object: 4547ms
    

    For some subcomponents and components, I have noticed that there exists a corresponding java.lang.Object injection which is even not visible in my bytecode. Not sure how it comes.

    good first issue 
    opened by amanjeetsingh150 0
  • Build fails sometimes when gradle reuses daemon

    Build fails sometimes when gradle reuses daemon

    D8: java.lang.NullPointerException org.gradle.workers.WorkerExecutionException: There were multiple failures while executing work items at org.gradle.workers.internal.DefaultWorkerExecutor.workerExecutionException(DefaultWorkerExecutor.java:266) at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:246) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.doProcess(DexArchiveBuilderTaskDelegate.kt:274) at com.android.build.gradle.internal.tasks.DexArchiveBuilderTask.doTaskAction(DexArchiveBuilderTask.kt:275) at com.android.build.gradle.internal.tasks.NewIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:66) at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51) at com.android.build.gradle.internal.tasks.NewIncrementalTask.taskAction(NewIncrementalTask.kt:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    Build fails sometimes fails with the above exception when gradle builds continuously runs reusing daemons. For solving this, I have to keep stopping gradle to reuse its daemon through:

    ./gradlew --stop or --no-daemon switch

    help wanted 
    opened by amanjeetsingh150 4
Owner
Amanjeet Singh
Android Developer
Amanjeet Singh
The dependency injection Dagger basics and the concepts are demonstrated in different branches

In this project we will look at the dependency injection Dagger basics and the concepts are demonstrated in different branches What is an Dependency?

Lloyd Dcosta 6 Dec 16, 2021
DI can be simple. Forget about modules and components. Just use it!

PopKorn - Kotlin Multiplatform DI PopKorn is a simple, powerful and lightweight Kotlin Multiplatform Dependency Injector. It doesn't need any modules

Pau Corbella 145 Dec 25, 2022
lite your android ! the code is on the way~

android-lite-auto lite your android, the code is on the way~ ! LiteAuto是一个代码生成框架,思路参考 JakeWharton 的开源项目 ButterKnife,在它的思路基础添加了一些自己的想法,从0到1设计并实现的。 Lite

马天宇 32 Nov 2, 2022
Bind Android views and callbacks to fields and methods.

Butter Knife Attention: This tool is now deprecated. Please switch to view binding. Existing versions will continue to work, obviously, but only criti

Jake Wharton 25.7k Jan 3, 2023
Bind Android views and callbacks to fields and methods.

Butter Knife Attention: This tool is now deprecated. Please switch to view binding. Existing versions will continue to work, obviously, but only criti

Jake Wharton 25.7k Mar 22, 2021
A fast dependency injector for Android and Java.

Dagger A fast dependency injector for Java and Android. Dagger is a compile-time framework for dependency injection. It uses no reflection or runtime

Google 16.9k Jan 5, 2023
A fast dependency injector for Android and Java.

Dagger 1 A fast dependency injector for Android and Java. Deprecated – Please upgrade to Dagger 2 Square's Dagger 1.x is deprecated in favor of Google

Square 7.3k Jan 5, 2023
Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 6 and above, brought to you by Google.

Guice Latest release: 5.0.1 Documentation: User Guide, 5.0.1 javadocs, Latest javadocs Continuous Integration: Mailing Lists: User Mailing List Licens

Google 11.7k Jan 1, 2023
A multi-purpose library containing view injection and threading for Android using annotations

SwissKnife A multi-purpose Groovy library containing view injection and threading for Android using annotations. It's based on both ButterKnife and An

Jorge Martin Espinosa 251 Nov 25, 2022
:syringe: Transfuse - A Dependency Injection and Integration framework for Google Android

Transfuse Transfuse is a Java Dependency Injection (DI) and integration library geared specifically for the Google Android API. There are several key

John Ericksen 224 Nov 28, 2022